Change MkTagged
to Tag
This commit is contained in:
parent
ffab765e86
commit
daf9eaef6e
|
@ -102,43 +102,42 @@ Functor f => Profunctor (Costar f) where
|
||||||
|
|
||||||
public export
|
public export
|
||||||
record Tagged (a : k) b where
|
record Tagged (a : k) b where
|
||||||
constructor MkTagged
|
constructor Tag
|
||||||
getTagged : b
|
getTagged : b
|
||||||
|
|
||||||
public export
|
public export
|
||||||
retag : Tagged a c -> Tagged b c
|
retag : Tagged a c -> Tagged b c
|
||||||
retag (MkTagged x) = MkTagged x
|
retag (Tag x) = Tag x
|
||||||
|
|
||||||
export
|
export
|
||||||
Functor (Tagged a) where
|
Functor (Tagged a) where
|
||||||
map f (MkTagged x) = MkTagged (f x)
|
map f (Tag x) = Tag (f x)
|
||||||
|
|
||||||
export
|
export
|
||||||
Applicative (Tagged a) where
|
Applicative (Tagged a) where
|
||||||
pure = MkTagged
|
pure = Tag
|
||||||
MkTagged f <*> MkTagged x = MkTagged (f x)
|
Tag f <*> Tag x = Tag (f x)
|
||||||
|
|
||||||
export
|
export
|
||||||
Monad (Tagged a) where
|
Monad (Tagged a) where
|
||||||
join = getTagged
|
join = getTagged
|
||||||
MkTagged x >>= f = f x
|
Tag x >>= f = f x
|
||||||
|
|
||||||
export
|
export
|
||||||
Foldable (Tagged a) where
|
Foldable (Tagged a) where
|
||||||
foldr f x (MkTagged y) = f y x
|
foldr f x (Tag y) = f y x
|
||||||
foldl f x (MkTagged y) = f x y
|
foldl f x (Tag y) = f x y
|
||||||
null = const False
|
null = const False
|
||||||
foldlM f x (MkTagged y) = f x y
|
foldlM f x (Tag y) = f x y
|
||||||
toList (MkTagged x) = [x]
|
toList (Tag x) = [x]
|
||||||
foldMap f (MkTagged x) = f x
|
foldMap f (Tag x) = f x
|
||||||
|
|
||||||
export
|
export
|
||||||
Traversable (Tagged a) where
|
Traversable (Tagged a) where
|
||||||
traverse f (MkTagged x) = map MkTagged (f x)
|
traverse f (Tag x) = map Tag (f x)
|
||||||
|
|
||||||
export
|
export
|
||||||
Profunctor Tagged where
|
Profunctor Tagged where
|
||||||
dimap _ f (MkTagged x) = MkTagged (f x)
|
dimap _ f (Tag x) = Tag (f x)
|
||||||
lmap = const retag
|
lmap = const retag
|
||||||
rmap f (MkTagged x) = MkTagged (f x)
|
rmap f (Tag x) = Tag (f x)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue