mirror of
https://github.com/Lysxia/first-class-families.git
synced 2024-09-11 19:47:12 +03:00
Add FMap to avoid clash with containers
This commit is contained in:
parent
24c14a0b17
commit
fc18ad42df
@ -8,12 +8,16 @@
|
||||
|
||||
module Fcf.Class.Functor
|
||||
( Map
|
||||
, FMap
|
||||
) where
|
||||
|
||||
import Fcf.Core (Exp, Eval)
|
||||
|
||||
-- | Type-level 'fmap' for type-level functors.
|
||||
--
|
||||
-- Note: this name clashes with 'Data.Map.Lazy.Map' from /containers/.
|
||||
-- 'FMap' is provided as a synonym to avoid this.
|
||||
--
|
||||
-- === __Example__
|
||||
--
|
||||
-- >>> import Fcf.Data.Nat
|
||||
@ -25,6 +29,9 @@ import Fcf.Core (Exp, Eval)
|
||||
-- = '[4, 9, 16, 25, 36]
|
||||
data Map :: (a -> Exp b) -> f a -> Exp (f b)
|
||||
|
||||
-- | Synonym of 'Map' to avoid name clashes.
|
||||
type FMap = Map
|
||||
|
||||
-- []
|
||||
type instance Eval (Map f '[]) = '[]
|
||||
type instance Eval (Map f (a ': as)) = Eval (f a) ': Eval (Map f as)
|
||||
|
Loading…
Reference in New Issue
Block a user