- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
instance Applicative (Sample m) where
pure a = Val a
Val{_unVal=f} <*> a = fmap f a
Fork{..} <*> a = Fork {
_next = \x -> (_next x) <*> a
, ..
}
Zero <*> _ = Zero
Random{..} <*> a = Random { -- Crazy-ass weirdo haskeller, why did you define instance Random for ->?!!
_next = \x -> (_next x) <*> a
, ..
}
Комментарии (6) RSS