Hoogle Search

Within LTS Haskell 24.19 (ghc-9.10.3)

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

  1. deriveSafeCopyHappstackDataIndexedType :: Version a -> Name -> Name -> [Name] -> Q [Dec]

    safecopy Data.SafeCopy.Internal

    No documentation available.

  2. deriveSafeCopyIndexedType :: Version a -> Name -> Name -> [Name] -> Q [Dec]

    safecopy Data.SafeCopy.Internal

    No documentation available.

  3. deriveSafeCopySimple :: Version a -> Name -> Name -> Q [Dec]

    safecopy Data.SafeCopy.Internal

    Derive an instance of SafeCopy. The instance derived by this function is simpler than the one derived by deriveSafeCopy in that we always use safePut and safeGet (instead of getSafePut and getSafeGet). When serializing, we put a Word8 describing the constructor (if the data type has more than one constructor) and, for each field of the constructor, we use safePut. For example, given the data type and the declaration below

    data T a b = C a a | D b Int
    deriveSafeCopySimple 1 'base ''T
    
    
    we generate
    instance (SafeCopy a, SafeCopy b) =>
    SafeCopy (T a b) where
    putCopy (C arg1 arg2) = contain $ do putWord8 0
    safePut arg1
    safePut arg2
    return ()
    putCopy (D arg1 arg2) = contain $ do putWord8 1
    safePut arg1
    safePut arg2
    return ()
    getCopy = contain $ do tag <- getWord8
    case tag of
    0 -> do return C <*> safeGet <*> safeGet
    1 -> do return D <*> safeGet <*> safeGet
    _ -> fail $ "Could not identify tag \"" ++
    show tag ++ "\" for type Main.T " ++
    "that has only 2 constructors.  " ++
    "Maybe your data is corrupted?"
    version = 1
    kind = base
    
    
    Using this simpler instance means that you may spend more bytes when serializing data. On the other hand, it is more straightforward and may match any other format you used in the past. Note that you may use deriveSafeCopy with one version of your data type and deriveSafeCopySimple in another version without any problems.

  4. deriveSafeCopySimpleIndexedType :: Version a -> Name -> Name -> [Name] -> Q [Dec]

    safecopy Data.SafeCopy.Internal

    No documentation available.

  5. deriveTextShow :: Name -> Q [Dec]

    text-show TextShow.TH

    Generates a TextShow instance declaration for the given data type or data family instance. Since: 2

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

    text-show TextShow.TH

    Generates a TextShow1 instance declaration for the given data type or data family instance. Since: 2

  7. deriveTextShow1Options :: Options -> Name -> Q [Dec]

    text-show TextShow.TH

    Like deriveTextShow1, but takes an Options argument. Since: 3.4

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

    text-show TextShow.TH

    Generates a TextShow2 instance declaration for the given data type or data family instance. Since: 2

  9. deriveTextShow2Options :: Options -> Name -> Q [Dec]

    text-show TextShow.TH

    Like deriveTextShow2, but takes an Options argument. Since: 3.4

  10. deriveTextShowOptions :: Options -> Name -> Q [Dec]

    text-show TextShow.TH

    Like deriveTextShow, but takes an Options argument. Since: 3.4

Page 17 of many | Previous | Next