summaryrefslogtreecommitdiff
path: root/Unlambda/Builtins.hs
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2014-04-10 05:25:03 +1000
committerJed Barber <jjbarber@y7mail.com>2014-04-10 05:25:03 +1000
commit281425310c5db21f87981eeb9601a71d1974d98d (patch)
treebef4643d906c93622c311fef2cf758fe94f1f651 /Unlambda/Builtins.hs
parente8695600977769008f285f9958eb043cca1b9b29 (diff)
Rearranging files
Diffstat (limited to 'Unlambda/Builtins.hs')
-rw-r--r--Unlambda/Builtins.hs70
1 files changed, 0 insertions, 70 deletions
diff --git a/Unlambda/Builtins.hs b/Unlambda/Builtins.hs
deleted file mode 100644
index bb054a1..0000000
--- a/Unlambda/Builtins.hs
+++ /dev/null
@@ -1,70 +0,0 @@
-module Unlambda.Builtins (
- k,
- s,
- i,
- dot,
- r,
- d,
- c,
- e
- ) where
-
-
-import Control.Exception( Exception(..), throw )
-
-
-
-data MyException = MyException { func :: a -> b }
- deriving (Show, Eq)
-
-instance Exception MyException
-
-
-
-k :: a -> b -> a
-k x y = x
-
-
-
-s :: (a -> b -> c) -> (a -> b) -> a -> c
-s x y z = (x z) (y z)
-
-
-
-i :: a -> a
-i = id
-
-
-
-class Void a where
- v :: a -> r
-
-instance Void v => Void (a -> r) where
- v x = v
-
-
-
-dot :: Char -> a -> IO a
-dot ch f = putChar ch >> return f
-
-
-
-r :: a -> IO a
-r f = putChar '\n' >> return f
-
-
-
--- may not work as per unlambda lazy semantics
-d :: (a -> b) -> (a -> b)
-d x = (\y -> x y)
-
-
-
-c :: (a -> b) -> (a -> b)
-c x = (`runCont` id) (callCC $ \cont -> x cont)
-
-
-
-e :: a -> b
-e x = throw (MyException x)
-