| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Distribution.Compat.Newtype
Description
Synopsis
Documentation
class Newtype n o | n -> o where #
The FunctionalDependencies version of Newtype type-class.
Note: for actual newtypes the implementation can be
pack = coerce; unpack = coerce. We don't have default implementation,
because Cabal have to support older than base >= 4.7 compilers.
Also, Newtype could witness a non-structural isomorphism.
Instances
| Newtype FilePathNT String # | |
Defined in Distribution.Parsec.Newtypes | |
| Newtype FreeText String # | |
| Newtype Token' String # | |
| Newtype Token String # | |
| Newtype TestedWith (CompilerFlavor, VersionRange) # | |
Defined in Distribution.Parsec.Newtypes Methods pack :: (CompilerFlavor, VersionRange) -> TestedWith # unpack :: TestedWith -> (CompilerFlavor, VersionRange) # | |
| Newtype SpecLicense (Either License License) # | |
Defined in Distribution.Parsec.Newtypes | |
| Newtype SpecVersion (Either Version VersionRange) # | |
Defined in Distribution.Parsec.Newtypes Methods pack :: Either Version VersionRange -> SpecVersion # unpack :: SpecVersion -> Either Version VersionRange # | |
| Newtype (Identity a) a # | |
| Newtype (Sum a) a # | |
| Newtype (Product a) a # | |
| Newtype (MQuoted a) a # | |
| Newtype (Endo a) (a -> a) # | |
| Newtype (List sep wrapper a) [a] # | |
ala :: (Newtype n o, Newtype n' o') => (o -> n) -> ((o -> n) -> b -> n') -> b -> o' #
>>>ala Sum foldMap [1, 2, 3, 4 :: Int]10
Note: the user supplied function for the newtype is ignored.
>>>ala (Sum . (+1)) foldMap [1, 2, 3, 4 :: Int]10