Skip to content

Instantly share code, notes, and snippets.

@MarcelineVQ
Created October 21, 2019 17:42
Show Gist options
  • Select an option

  • Save MarcelineVQ/af780d986be3002df13a9932ec0add7b to your computer and use it in GitHub Desktop.

Select an option

Save MarcelineVQ/af780d986be3002df13a9932ec0add7b to your computer and use it in GitHub Desktop.
data Trampoline : (m : Type -> Type) -> (r : Type) -> Type where
MkTram : m (Either (Trampoline m r) r) -> Trampoline m r
partial
Functor m => Functor (Trampoline m) where
map f (MkTram x) = MkTram (map (either (Left . map f) (Right . f)) x)
|
40 | map f (MkTram x) = MkTram (map (either (Left . map f) (Right . f)) x)
| ~~~~~~~~~~~~~~~~~
Prelude.Functor.Stream.Trampoline m implementation of Prelude.Functor.Functor, method map is possibly not total due to: Stream.MkTram
------------------------------
data Trampoline : (m : Type -> Type) -> (r : Type) -> Type where
MkTram : m (Either (Trampoline m r) r) -> Trampoline m r
partial
tmap : Functor m => (a -> b) -> Trampoline m a -> Trampoline m b
tmap f (MkTram x) = MkTram (map (either (Left . tmap f) (Right . f)) x)
partial
Functor m => Functor (Trampoline m) where
map f x = tmap f x
45 | map f x = tmap f x
| ~~~~~~~~~~~~~~~~~~
Prelude.Functor.Stream.Trampoline m implementation of Prelude.Functor.Functor, method map is possibly not total due to: Stream.tmap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment