module Feldspar.Core.Constructs.Floating
( FLOATING (..)
) where
import Language.Syntactic
import Language.Syntactic.Constructs.Binding
import Feldspar.Core.Types
import Feldspar.Core.Interpretation
data FLOATING a
where
Pi :: (Type a, Floating a) => FLOATING (Full a)
Exp :: (Type a, Floating a) => FLOATING (a :-> Full a)
Sqrt :: (Type a, Floating a) => FLOATING (a :-> Full a)
Log :: (Type a, Floating a) => FLOATING (a :-> Full a)
Pow :: (Type a, Floating a) => FLOATING (a :-> a :-> Full a)
LogBase :: (Type a, Floating a) => FLOATING (a :-> a :-> Full a)
Sin :: (Type a, Floating a) => FLOATING (a :-> Full a)
Tan :: (Type a, Floating a) => FLOATING (a :-> Full a)
Cos :: (Type a, Floating a) => FLOATING (a :-> Full a)
Asin :: (Type a, Floating a) => FLOATING (a :-> Full a)
Atan :: (Type a, Floating a) => FLOATING (a :-> Full a)
Acos :: (Type a, Floating a) => FLOATING (a :-> Full a)
Sinh :: (Type a, Floating a) => FLOATING (a :-> Full a)
Tanh :: (Type a, Floating a) => FLOATING (a :-> Full a)
Cosh :: (Type a, Floating a) => FLOATING (a :-> Full a)
Asinh :: (Type a, Floating a) => FLOATING (a :-> Full a)
Atanh :: (Type a, Floating a) => FLOATING (a :-> Full a)
Acosh :: (Type a, Floating a) => FLOATING (a :-> Full a)
instance Semantic FLOATING
where
semantics Pi = Sem "pi" Prelude.pi
semantics Exp = Sem "exp" Prelude.exp
semantics Sqrt = Sem "sqrt" Prelude.sqrt
semantics Log = Sem "log" Prelude.log
semantics Pow = Sem "(**)" (Prelude.**)
semantics LogBase = Sem "logBase" Prelude.logBase
semantics Sin = Sem "sin" Prelude.sin
semantics Tan = Sem "tan" Prelude.tan
semantics Cos = Sem "cos" Prelude.cos
semantics Asin = Sem "asin" Prelude.asin
semantics Atan = Sem "atan" Prelude.atan
semantics Acos = Sem "acos" Prelude.acos
semantics Sinh = Sem "sinh" Prelude.sinh
semantics Tanh = Sem "tanh" Prelude.tanh
semantics Cosh = Sem "cosh" Prelude.cosh
semantics Asinh = Sem "asinh" Prelude.asinh
semantics Atanh = Sem "atanh" Prelude.atanh
semantics Acosh = Sem "acosh" Prelude.acosh
semanticInstances ''FLOATING
instance EvalBind FLOATING where evalBindSym = evalBindSymDefault
instance AlphaEq dom dom dom env => AlphaEq FLOATING FLOATING dom env
where
alphaEqSym = alphaEqSymDefault
instance Sharable FLOATING
instance Monotonic FLOATING
instance SizeProp (FLOATING :|| Type)
where
sizeProp (C' s) = sizePropDefault s
instance ( (FLOATING :|| Type) :<: dom
, OptimizeSuper dom)
=> Optimize (FLOATING :|| Type) dom
where
constructFeatUnOpt opts a@(C' _) = constructFeatUnOptDefault opts a