Skip to content

Instantly share code, notes, and snippets.

View mrsekut's full-sized avatar
🥺
カタカタな世界に生きたい

kota marusue mrsekut

🥺
カタカタな世界に生きたい
View GitHub Profile
#! /usr/bin/env nix-shell
#! nix-shell -p "pkgs.haskell.packages.ghc925.ghcWithPackages (p: [p.free])"
#! nix-shell -i "runhaskell"
import Control.Monad.Free (Free (..), liftF)
-- DSLのInterfaceを定義
data CalcF a
= Add Int a
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TupleSections #-}
module Bowling (score, BowlingError(..)) where
import Control.Applicative (Applicative (..))
import Control.Monad
import Control.Monad.State (MonadState (get, put), MonadTrans (lift),
StateT, runStateT)