app

Safe Haskell None
Language Haskell2010

Shared

Contents

Description

This module contains the subset of the model that is needed by Game I didn't want to make Game depend on Model, because it seemed overkill and dangerous cyclewise in the long run. Hence I introduced this module. |

Synopsis

Documentation

create :: [Card UI] -> [Pack] -> [TileUI] -> StdGen -> Model #

creatureToFilepath :: Model -> Creature UI -> Maybe Filepath #

Maps a creature to the filepath of its tile.

getInitialDeck :: Model -> Team -> [Card Core] #

The starting deck of the given team, not shuffled

keyToCard :: Key a => Model -> a -> Maybe (Card UI) #

The 'UI version of a key

class Lift p where #

Methods

lift :: Model -> p Core -> p UI #

Instances
Lift ItemObject #  
Instance details

Defined in Shared

Methods

lift :: Model -> ItemObject Core -> ItemObject UI #

Lift NeutralObject #  
Instance details

Defined in Shared

class Mlift p where #

Methods

mlift :: Model -> p Core -> Maybe (p UI) #

Instances
Mlift Card #  
Instance details

Defined in Shared

Methods

mlift :: Model -> Card Core -> Maybe (Card UI) #

Mlift Creature #

Translates a Core Creature into an UI one, keeping its stats An alternative implementation could return the pristine, formal, UI card.

Instance details

Defined in Shared

Methods

mlift :: Model -> Creature Core -> Maybe (Creature UI) #

data Model #

The part of the model that is likely to be used by all pages i.e. all possible models ! If you add a field, extend the EQ instance below. ! Note that we MUST have an EQ instance, because ultimately, our top-level model should have one. It is required by miso in the startApp function. It makes sense, since miso does diffs on models.

Instances
Eq Model #  
Instance details

Defined in Shared

Methods

(==) :: Model -> Model -> Bool #

(/=) :: Model -> Model -> Bool #

Show Model #  
Instance details

Defined in Shared

Methods

showsPrec :: Int -> Model -> ShowS #

show :: Model -> String #

showList :: [Model] -> ShowS #

Generic Model #  
Instance details

Defined in Shared

Associated Types

type Rep Model :: Type -> Type #

Methods

from :: Model -> Rep Model x #

to :: Rep Model x -> Model #

RandomGen Model #

Instance to be able to use Model like a random generator.

Instance details

Defined in Shared

Methods

next :: Model -> (Int, Model) #

genRange :: Model -> (Int, Int) #

split :: Model -> (Model, Model) #

With (Kernel a) (Model, T Core, T UI) #  
Instance details

Defined in Move

Methods

with :: Kernel a -> (Model, T Core, T UI) -> Kernel a #

Contains (Kernel a) (Model, T Core, T UI) #  
Instance details

Defined in Move

Methods

to :: Kernel a -> (Model, T Core, T UI) #

With (Kernel a) (Model, T Core, T UI, Animation) #  
Instance details

Defined in Move

Methods

with :: Kernel a -> (Model, T Core, T UI, Animation) -> Kernel a #

Contains (Kernel a) (Model, T Core, T UI, Animation) #  
Instance details

Defined in Move

Methods

to :: Kernel a -> (Model, T Core, T UI, Animation) #

type Rep Model #  
Instance details

Defined in Shared

unsafeGet :: Model #

An instance of Model that is fine for debugging. Don't use it in production!

unsafeKeyToCard :: Show a => Key a => Model -> a -> Card UI #

Orphan instances

Eq StdGen #  
Instance details

Methods

(==) :: StdGen -> StdGen -> Bool #

(/=) :: StdGen -> StdGen -> Bool #