essence-of-live-coding-0.2.0.1: General purpose live coding framework

Safe HaskellSafe
LanguageHaskell2010

LiveCoding.Migrate.Migration

Synopsis

Documentation

data Migration Source #

Constructors

Migration 

Fields

Instances
Semigroup Migration Source #

If both migrations would succeed, the result from the first is used.

Instance details

Defined in LiveCoding.Migrate.Migration

Monoid Migration Source # 
Instance details

Defined in LiveCoding.Migrate.Migration

runSafeMigration :: (Data a, Data b) => Migration -> a -> b -> a Source #

Run a migration and insert the new initial state in case of failure.

castMigration :: Migration Source #

Try to migrate by casting the first type into the second

newtypeMigration :: Migration Source #

Migrate a value into a newtype wrapping

userMigration :: (Typeable c, Typeable d) => (c -> d) -> Migration Source #

If you have a specific type that you would like to be migrated to a specific other type, you can create a migration for this. For example: userMigration (toInteger :: Int -> Integer)

migrationTo2 :: Typeable t => (forall a b c. (Typeable a, Typeable b, Typeable c) => t b c -> a -> Maybe (t b c)) -> Migration Source #

constMigrationFrom2 :: Typeable t => (forall a b c. (Typeable a, Typeable b, Typeable c) => t b c -> Maybe a) -> Migration Source #

migrationTo1 :: Typeable t => (forall a b. (Typeable a, Typeable b) => t b -> a -> Maybe (t b)) -> Migration Source #