spiros-0.4.2: Spiros Boosalis's Custom Prelude

Safe HaskellSafe
LanguageHaskell2010

Prelude.Spiros.Types

Description

re-export custom data types that are generally useful for me.

the newtypes distinguish them with more meaningful names (of constructors, accessors, transformers, etc), but still support the convenience of automatically deriving as many instances as correct.

Synopsis

Documentation

type (:~>) f g = forall x. f x -> g x Source #

a natural transformation

type (:.) f g x = f (g x) Source #

 

type (:.:) = Compose Source #

 (f :.: g) a  ≡  f (g a)

type (:*:) = Product Source #

(f :*: g) a  ≡  (f a, g a)

type (:+:) = Sum Source #

(f :+: g) a  ≡  Either (f a) (g a)

type P = Proxy Source #

P a ≡ ()

type C = Const Source #

C a b ≡ a

type I = Identity Source #

I a ≡ a

type HaskellName = Name Source #

a haskell identifier, via TemplateHaskellQuotes.

> :set -XTemplateHaskellQuotes
> 'fmap :: HaskellName

type CanInterpolate t = (IsString t, Monoid t) Source #

for `interpolatedstring-perl6` i.e. the type supports string literals (via IsString) and can be appended (via Monoid).

uses ConstraintKinds.

e.g.

-- -XQuasiQuotes
import Text.InterpolatedString.Perl6 (qq)

hello :: (CanInterpolate t) => t -> t
hello t = [qc| "hello" ++ $t |]

helloworld = hello "world" :: String

type BoundedEnum a = (Enum a, Bounded a) Source #

a finite type, whose values may be enumerated into a finite list.

type List a = [a] Source #

alphanumeric alias

pattern (:*:) :: f a -> g a -> Product f g a Source #

pattern P :: forall (a :: k). Proxy a Source #

pattern C :: forall a b. a -> Const a b Source #

pattern I :: a -> Identity a Source #