]> Git — Sourcephile - tmp/julm/symantic-reify.git/blob - SemanticEval.hs
a20b60504c83b9b641bb200f5b6df6f8eff3dd35
[tmp/julm/symantic-reify.git] / SemanticEval.hs
1 -- | Semantics for Identity (aka. R, or meta-circular representation).
2 module SemanticEval where
3
4 import Data.Functor.Identity
5 import Syntax
6
7 instance Abstractable Identity where
8 lam f = Identity (runIdentity . f . Identity)
9 (.@) f x = Identity ((runIdentity f) (runIdentity x))
10 {- Defined in Data.Functor.Identity
11 instance Num a => Num (Identity a)
12 instance Fractional a => Fractional (Identity a)
13 -}
14
15 eval :: Identity a -> a
16 eval = runIdentity