PatternSyns

Safe Haskell | Safe

PatternSyns

Description

Testing some pattern synonyms

Synopsis

- data FooType x = FooCtor x
- pattern Foo :: forall x. x -> FooType x
- pattern Bar :: forall x. x -> FooType (FooType x)
- pattern (:<->) :: forall x x1. x -> x1 -> (FooType x, FooType (FooType x1))
- data BlubType = Show x => BlubCtor x
- pattern Blub :: () => forall x. Show x => x -> BlubType
- data (a :: *) >< b = Empty
- pattern E :: forall k a (b :: k). a >< b
- pattern PatWithExplicitSig :: Eq somex => somex -> FooType somex

# Documentation

data FooType x #

FooType doc

Constructors

FooCtor x |

pattern Foo :: forall x. x -> FooType x #

Pattern synonym for `Foo` x

pattern Bar :: forall x. x -> FooType (FooType x) #

Pattern synonym for `Bar` x

pattern (:<->) :: forall x x1. x -> x1 -> (FooType x, FooType (FooType x1)) #

Pattern synonym for (`:<->`)

data BlubType #

BlubType is existentially quantified

Constructors

Show x => BlubCtor x |

pattern Blub :: () => forall x. Show x => x -> BlubType #

Pattern synonym for `Blub` x

data (a :: *) >< b #

Doc for (`><`)

Constructors

Empty |

pattern E :: forall k a (b :: k). a >< b #

Pattern for `Empty`

pattern PatWithExplicitSig :: Eq somex => somex -> FooType somex #

Earlier ghc versions didn't allow explicit signatures on pattern synonyms.