Skip to content

Instantly share code, notes, and snippets.

View darcykimball's full-sized avatar
😶

darcykimball

😶
View GitHub Profile
@darcykimball
darcykimball / MonadPred.hs
Created October 25, 2019 10:36
Insomnia: `monad-loops`
-- There are some functions manipulating values of type Monad m => (a -> m Bool)
-- in `monad-loops`. Feels like they're special cases of something more general?
module MonadPred where
import Data.Monoid (Any(..), All(..), First(..))
import Control.Monad (liftM2)
import Control.Monad.Reader
@darcykimball
darcykimball / Shake.hs
Created January 31, 2019 22:40
Shake a circle in gloss
module Shake where
import Graphics.Gloss.Interface.Pure.Game
-- An animation is represented as a function of time on some interval
data Animation a = Animation {
_animationDuration :: Float
, _animationFunction :: Float -> a