-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.hs
75 lines (51 loc) · 1.36 KB
/
Main.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE LinearTypes #-}
module Main where
data Ur a where
Ur :: a -> Ur a
data A
data B
data C
data R
data State b a = State (Ur b %1 -> (a, Ur b))
-- f :: (a %1 -> b) %1 -> a %1 -> b
-- f = _
return :: a %1 -> Maybe a
return = _
empty :: Maybe a
empty = _
map' :: (a %1 -> b) -> [a] %1 -> [b]
map' = _
-- t :: Ur a
-- t = _
-- map' :: (A %1 -> B) -> [A] %1 -> [B]
-- map' = _
-- m :: a
-- m = _
-- (>>=) :: Maybe A %1 -> (A %1 -> Maybe B) -> Maybe B
-- (>>=) = _
-- return :: A %1 -> State B A
-- return = _
-- (>>=) :: State B A %1 -> (A %1 -> Maybe B) -> Maybe B
-- (>>=) = _
-- runState :: State B A %1 -> (B -> (A, Ur B))
-- runState = _
-- fromMaybe :: A -> Maybe A %1 -> A
-- fromMaybe = _
-- bind :: State C A %1 -> (A %1 -> State C B) %1 -> State C B
-- bind = \ moon -> \ earth
-- -> case moon of
-- (State water)
-- -> State
-- (\ fire
-- -> case fire of
-- (Ur air)
-- -> case
-- earth (case water (Ur air) of (e, f) -> case f of (Ur g) -> e)
-- of
-- (State b) -> b (Ur air))
-- concat :: [[A]] %1 -> [A]
-- concat = _
main :: IO ()
main = print $ 1