Hoogle Search

Within LTS Haskell 24.6 (ghc-9.10.2)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. derivePersistField :: String -> Q [Dec]

    classy-prelude-yesod ClassyPrelude.Yesod

    Automatically creates a valid PersistField instance for any datatype that has valid Show and Read instances. Can be very convenient for Enum types.

  2. derivePersistFieldJSON :: String -> Q [Dec]

    classy-prelude-yesod ClassyPrelude.Yesod

    Automatically creates a valid PersistField instance for any datatype that has valid ToJSON and FromJSON instances. For a datatype T it generates instances similar to these:

    instance PersistField T where
    toPersistValue = PersistByteString . L.toStrict . encode
    fromPersistValue = (left T.pack) . eitherDecodeStrict' <=< fromPersistValue
    instance PersistFieldSql T where
    sqlType _ = SqlString
    

  3. deriveCPointed :: Name -> DecsQ

    czipwith Data.CZipWith

    Derives a cPointed instance for a datatype of kind (* -> *) -> *. Requires that for this datatype (we shall call its argument f :: * -> * here)

    • there is exactly one constructor;
    • all fields in the one constructor are either of the form f x for some x or of the form X f for some type X where there is an instance cPointed X.
    For example, the following would be valid usage:
    data A f = A
    { a_str  :: f String
    , a_bool :: f Bool
    }
    
    data B f = B
    { b_int   :: f Int
    , b_float :: f Float
    , b_a     :: A f
    }
    
    derivecPointed ''A
    derivecPointed ''B
    
    This produces the following instances:
    instance cPointed A where
    cPoint f = A f f
    
    instance cPointed B where
    cPoint f = B f f (cPoint f f)
    

  4. deriveCZipWith :: Name -> DecsQ

    czipwith Data.CZipWith

    Derives a CZipWith instance for a datatype of kind (* -> *) -> *. Requires that for this datatype (we shall call its argument f :: * -> * here)

    • there is exactly one constructor;
    • all fields in the one constructor are either of the form f x for some x or of the form X f for some type X where there is an instance CZipWith X.
    For example, the following would be valid usage:
    data A f = A
    { a_str  :: f String
    , a_bool :: f Bool
    }
    
    data B f = B
    { b_int   :: f Int
    , b_float :: f Float
    , b_a     :: A f
    }
    
    deriveCZipWith ''An
    deriveCZipWith ''B
    
    This produces the following instances:
    instance CZipWith A where
    cZipWith f (A x1 x2) (A y1 y2) = A (f x1 y1) (f x2 y2)
    
    instance CZipWith B wheren
    cZipWith f (B x1 x2 x3) (B y1 y2 y3) =
    B (f x1 y1) (f x2 y2) (cZipWith f x3 y3)
    

  5. deriveCZipWithM :: Name -> DecsQ

    czipwith Data.CZipWith

    Derives a CZipWithM instance for a datatype of kind (* -> *) -> *. Requires that for this datatype (we shall call its argument f :: * -> * here)

    • there is exactly one constructor;
    • all fields in the one constructor are either of the form f x for some x or of the form X f for some type X where there is an instance CZipWithM X.
    For example, the following would be valid usage:
    data A f = A
    { a_str  :: f String
    , a_bool :: f Bool
    }
    
    data B f = B
    { b_int   :: f Int
    , b_float :: f Float
    , b_a     :: A f
    }
    
    deriveCZipWithM ''A
    deriveCZipWithM ''B
    
    This produces the following instances:
    instance CZipWithM A where
    cZipWithM f (A x1 x2) (A y1 y2) = A <$> f x1 y1 <*> f x2 y2
    
    instance CZipWith B where
    cZipWithM f (B x1 x2 x3) (B y1 y2 y3) =
    B <$> f x1 y1 <*> f x2 y2 <*> cZipWithM f x3 y3
    

  6. deriveCsvViaSci :: Name -> Q [Dec]

    detour-via-sci Data.Via.Scientific

    Similar to deriveJsonViaSci but for instances of ToField and FromField.

    >>> deriveCsvViaSci ''Lat
    ...
    

  7. deriveDecimalPlaces :: DecimalPlaces -> Name -> Q [Dec]

    detour-via-sci Data.Via.Scientific

    Taking a number of decimal places from the given DecimalPlaces newtype, derives an instance of DefaultDecimalPlaces.

    >>> deriveDecimalPlaces (DecimalPlaces 8) ''Lat
    ...
    

  8. deriveJsonViaSci :: Name -> Q [Dec]

    detour-via-sci Data.Via.Scientific

    Derives an instance of ToJSON wrapping the value with ViaSci before encoding. Similarly the value is decoded as ViaSci and then unwrapped in the derived instance of FromJSON.

    >>> deriveJsonViaSci ''Lat
    ...
    

  9. deriveMPPEKeys :: ByteString -> ByteString -> Except CryptoError (ByteString, ByteString)

    eap Network.EAP.MSCHAPv2

    Derive Microsoft Point-to-Point Encryption (MPPE) keys see [RFC3079]

  10. deriveViaOnLoc :: DynFlags -> SrcSpan

    ghc-lib GHC

    No documentation available.

Page 52 of many | Previous | Next