liquidhaskell-boot-0.9.2.5.0: Liquid Types for Haskell
Safe HaskellSafe-Inferred
LanguageHaskell98

Language.Haskell.Liquid.Types.Generics

Description

Geriving instances, generically. This module shares some of the underlying ideas and implementations of the generic-data package, allowing us to derive a bunch of instances using the underlying Generic implementation, but in a more declarative way.

In particular we introduc the Generically newtype wrapper to be used with '-XDerivingVia' to make derivation explicit. For example:

  data Foo = Foo
       deriving Generic
       deriving Eq via Generically Foo
Synopsis

Documentation

newtype Generically a Source #

Constructors

Generically a 

Instances

Instances details
Generic (Generically a) Source # 
Instance details

Defined in Language.Haskell.Liquid.Types.Generics

Associated Types

type Rep (Generically a) :: Type -> Type #

Methods

from :: Generically a -> Rep (Generically a) x #

to :: Rep (Generically a) x -> Generically a #

(Generic a, GBinaryPut (Rep a), GBinaryGet (Rep a)) => Binary (Generically a) Source # 
Instance details

Defined in Language.Haskell.Liquid.Types.Generics

Methods

put :: Generically a -> Put #

get :: Get (Generically a) #

putList :: [Generically a] -> Put #

(Generic a, Eq (Rep a ())) => Eq (Generically a) Source # 
Instance details

Defined in Language.Haskell.Liquid.Types.Generics

(Eq (Generically a), Generic a, GHashable Zero (Rep a)) => Hashable (Generically a) Source # 
Instance details

Defined in Language.Haskell.Liquid.Types.Generics

Methods

hashWithSalt :: Int -> Generically a -> Int #

hash :: Generically a -> Int #

type Rep (Generically a) Source # 
Instance details

Defined in Language.Haskell.Liquid.Types.Generics

type Rep (Generically a) = D1 ('MetaData "Generically" "Language.Haskell.Liquid.Types.Generics" "liquidhaskell-boot-0.9.2.5.0-JuBNLAGIRFD6ItsPyAO3oF" 'True) (C1 ('MetaCons "Generically" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

Hashable

Binary

Eq

geq :: (Generic a, Eq (Rep a ())) => a -> a -> Bool Source #

Generic (==).

instance Eq MyType where
  (==) = geq

from' :: Generic a => a -> Rep a () Source #

A helper for better type inference.

to' :: Generic a => Rep a () -> a Source #