Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type Time = Double
- class Monad m => MonadObjective m where
- (.&) :: (MonadObjective m, Stateful s e) => Address e m -> StateT s m a -> m a
- data System s a
- runSystem :: WindowMode -> BoundingBox2 -> (forall s. System s a) -> IO (Maybe a)
- runSystemDefault :: (forall s. System s a) -> IO (Maybe a)
- class (MonadIO m, MonadObjective m) => MonadSystem m where
- linkMouse :: Mouse e => Address e m -> m ()
- linkKeyboard :: Keyboard e => Address e m -> m ()
- linkGraphic :: Graphic e => Address e m -> m ()
- linkAudio :: Audio e => Address e m -> m ()
- unlinkMouse :: Address e m -> m ()
- unlinkKeyboard :: Address e m -> m ()
- unlinkGraphic :: Address e m -> m ()
- unlinkAudio :: Address e m -> m ()
- stand :: m ()
- wait :: Double -> m ()
- module Control.Object
- class Mouse f where
- cursorEvent :: Vec2 -> f ()
- scrollEvent :: Vec2 -> f ()
- mouseButtonEvent :: Int -> Bool -> f ()
- class Keyboard f where
- class Graphic e where
- pullGraphic :: Time -> e (Picture ())
- class Audio e where
- data PullGraphic a = PullGraphic !Time (Picture () -> a)
- data PullAudio a = PullAudio !Time !Int ([V2 Float] -> a)
- data KeyEvent a = KeyEvent !Key !Bool a
- data MouseEvent a
- = CursorEvent !Vec2 a
- | ScrollEvent !Vec2 a
- | MouseButtonEvent !Int !Bool a
- data WindowMode
- type BoundingBox2 = Box V2 Double
- data Box f a :: (* -> *) -> * -> * = Box (f a) (f a)
- isInside :: (Applicative f, Foldable f, Ord a) => f a -> Box f a -> Bool
- newtype Picture a = Picture {
- runPicture :: forall m. (Applicative m, Monad m, Picture2D m) => m a
- data Bitmap
- readBitmap :: MonadIO m => FilePath -> m Bitmap
- class Functor p => Affine p where
- class Affine p => Picture2D p where
- newtype Source a = Source (Time -> a)
- readWAVE :: MonadIO m => FilePath -> m (Source Stereo)
- data Key
- = KeyUnknown
- | KeySpace
- | KeyApostrophe
- | KeyComma
- | KeyMinus
- | KeyPeriod
- | KeySlash
- | Key0
- | Key1
- | Key2
- | Key3
- | Key4
- | Key5
- | Key6
- | Key7
- | Key8
- | Key9
- | KeySemicolon
- | KeyEqual
- | KeyA
- | KeyB
- | KeyC
- | KeyD
- | KeyE
- | KeyF
- | KeyG
- | KeyH
- | KeyI
- | KeyJ
- | KeyK
- | KeyL
- | KeyM
- | KeyN
- | KeyO
- | KeyP
- | KeyQ
- | KeyR
- | KeyS
- | KeyT
- | KeyU
- | KeyV
- | KeyW
- | KeyX
- | KeyY
- | KeyZ
- | KeyLeftBracket
- | KeyBackslash
- | KeyRightBracket
- | KeyGraveAccent
- | KeyWorld1
- | KeyWorld2
- | KeyEscape
- | KeyEnter
- | KeyTab
- | KeyBackspace
- | KeyInsert
- | KeyDelete
- | KeyRight
- | KeyLeft
- | KeyDown
- | KeyUp
- | KeyPageUp
- | KeyPageDown
- | KeyHome
- | KeyEnd
- | KeyCapsLock
- | KeyScrollLock
- | KeyNumLock
- | KeyPrintScreen
- | KeyPause
- | KeyF1
- | KeyF2
- | KeyF3
- | KeyF4
- | KeyF5
- | KeyF6
- | KeyF7
- | KeyF8
- | KeyF9
- | KeyF10
- | KeyF11
- | KeyF12
- | KeyF13
- | KeyF14
- | KeyF15
- | KeyF16
- | KeyF17
- | KeyF18
- | KeyF19
- | KeyF20
- | KeyF21
- | KeyF22
- | KeyF23
- | KeyF24
- | KeyF25
- | KeyPad0
- | KeyPad1
- | KeyPad2
- | KeyPad3
- | KeyPad4
- | KeyPad5
- | KeyPad6
- | KeyPad7
- | KeyPad8
- | KeyPad9
- | KeyPadDecimal
- | KeyPadDivide
- | KeyPadMultiply
- | KeyPadSubtract
- | KeyPadAdd
- | KeyPadEnter
- | KeyPadEqual
- | KeyLeftShift
- | KeyLeftControl
- | KeyLeftAlt
- | KeyLeftSuper
- | KeyRightShift
- | KeyRightControl
- | KeyRightAlt
- | KeyRightSuper
- | KeyMenu
- charToKey :: Char -> Key
- liftIO :: MonadIO m => forall a. IO a -> m a
- loadBitmapsWith :: ExpQ -> FilePath -> Q [Dec]
- module Control.Monad
- module Control.Applicative
- module Control.Bool
- module Data.Color
- module Data.Color.Names
- module Linear
System
class Monad m => MonadObjective m where
(.-) :: Address e m -> e a -> m a infix 3
Send a message to the pointed one.
new :: Object e (Residence m) -> m (Address e m)
Add an object to the environment.
MonadObjective IO | |
MonadObjective m => MonadObjective (IdentityT m) | |
MonadObjective m => MonadObjective (ListT m) | |
MonadObjective m => MonadObjective (MaybeT m) | |
MonadObjective (System s) | |
MonadObjective m => MonadObjective (ContT r m) | |
MonadObjective m => MonadObjective (ReaderT r m) | |
MonadObjective m => MonadObjective (StateT s m) | |
MonadObjective m => MonadObjective (StateT s m) | |
MonadObjective m => MonadObjective (ExceptT er m) | |
(Monoid w, MonadObjective m) => MonadObjective (WriterT w m) | |
(Monoid w, MonadObjective m) => MonadObjective (WriterT w m) | |
(Monoid w, MonadObjective m) => MonadObjective (RWST r w s m) | |
(Monoid w, MonadObjective m) => MonadObjective (RWST r w s m) |
(.&) :: (MonadObjective m, Stateful s e) => Address e m -> StateT s m a -> m a infix 3
runSystem :: WindowMode -> BoundingBox2 -> (forall s. System s a) -> IO (Maybe a) Source
runSystemDefault :: (forall s. System s a) -> IO (Maybe a) Source
class (MonadIO m, MonadObjective m) => MonadSystem m where Source
linkMouse :: Mouse e => Address e m -> m () Source
linkKeyboard :: Keyboard e => Address e m -> m () Source
linkGraphic :: Graphic e => Address e m -> m () Source
linkAudio :: Audio e => Address e m -> m () Source
unlinkMouse :: Address e m -> m () Source
unlinkKeyboard :: Address e m -> m () Source
unlinkGraphic :: Address e m -> m () Source
unlinkAudio :: Address e m -> m () Source
MonadSystem (System s) |
Component crafting
module Control.Object
cursorEvent :: Vec2 -> f () Source
scrollEvent :: Vec2 -> f () Source
mouseButtonEvent :: Int -> Bool -> f () Source
Mouse MouseEvent | |
Mouse e => Mouse (AccessT s e) |
pullGraphic :: Time -> e (Picture ()) Source
Graphic PullGraphic | |
Graphic e => Graphic (AccessT s e) |
Free instances
data PullGraphic a Source
PullGraphic !Time (Picture () -> a) |
data MouseEvent a Source
CursorEvent !Vec2 a | |
ScrollEvent !Vec2 a | |
MouseButtonEvent !Int !Bool a |
Concrete types
data WindowMode Source
type BoundingBox2 = Box V2 Double Source
data Box f a :: (* -> *) -> * -> *
The type of bounding box for arbitrary vector f
.
The functions for this type assume that f
is a "zipping" Applicative
.
Box (f a) (f a) |
isInside :: (Applicative f, Foldable f, Ord a) => f a -> Box f a -> Bool
check whether the point is in the box.
Picture | |
|
readBitmap :: MonadIO m => FilePath -> m Bitmap Source
Load an image file.
class Affine p => Picture2D p where Source
The class of types that can be regarded as a kind of picture.
bitmap :: Bitmap -> p () Source
bitmapOnce :: Bitmap -> p () Source
Same as bitmap
, but it does not create a cache.
polygon :: [Vec2] -> p () Source
polygonOutline :: [Vec2] -> p () Source
circle :: Double -> p () Source
circleOutline :: Double -> p () Source
thickness :: Float -> p a -> p a infixr 5 Source
IO
loadBitmapsWith :: ExpQ -> FilePath -> Q [Dec] Source
The type of the given ExpQ
must be FilePath -> IO FilePath
FIXME: This may cause name duplication if there are multiple non-alphanumeric file names.
Reexports
module Control.Monad
module Control.Applicative
module Control.Bool
module Data.Color
module Data.Color.Names
module Linear