This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module RPG.Data.StoryImpl | |
| ( runStory | |
| , dopestory | |
| , mkCoStory | |
| ) where | |
| import Control.Comonad | |
| import Control.Comonad.Trans.Cofree | |
| import Control.Monad (void) | |
| import Control.Monad.IO.Class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type family Apply g a b :: * where | |
| Apply (->) a b = a -> b | |
| Apply Snd a b = b | |
| data StoryF g a = Change Character ChangeType (Apply g ChangeResult a) | |
| | forall x x'. Interrupt (Free (StoryF g) x') | |
| (Free (StoryF g) x) | |
| (Apply g x a) | |
| | Macguffin (Apply g Desirable a) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| runStoryApp :: Comonad w => StoryApp a -> CoStoryAppT w b -> (a, b) | |
| runStoryApp = pairEffect (,) | |
| runStory :: Comonad w => Story a -> CoStoryT w b -> (a, b) | |
| runStory = pairEffect (,) | |
| mkCoStoryApp :: Comonad w | |
| => w b | |
| -> (w b -> Character -> ChangeType -> w b) | |
| -> (forall x y . (forall a. Story a -> b) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE FunctionalDependencies #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| {-# LANGUAGE LambdaCase #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE PolyKinds #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE TypeFamilies #-} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| {-# LANGUAGE AllowAmbiguousTypes #-} | |
| {-# LANGUAGE ConstraintKinds #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE DeriveFunctor #-} | |
| {-# LANGUAGE ExistentialQuantification #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE InstanceSigs #-} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| map d closeTab | |
| map <Enter> openCommandBar | |
| map <C-A> incrementURLPath | |
| map <C-X> decrementURLPath | |
| map u lastClosedTab | |
| unmap x | |
| let barposition = "bottom" | |
| let qmark g = ["http://github.com/isovector"] | |
| let qmark m = ["http://gmail.com"] | |
| let qmark b = ["http://goodreads.com"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| {-# LANGUAGE PartialTypeSignatures #-} | |
| {-# LANGUAGE InstanceSigs #-} | |
| {-# LANGUAGE TypeInType #-} | |
| {-# LANGUAGE UndecidableInstances #-} | |
| {-# LANGUAGE ConstraintKinds #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE ExistentialQuantification #-} | |
| {-# LANGUAGE FlexibleContexts #-} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Data.Semigroup | |
| import Control.Comonad | |
| import Control.Comonad.Store | |
| pascalLine :: Store (Int, Int) Int -> Int | |
| pascalLine w | x <= 0 = 1 | |
| | y <= 0 = 1 | |
| | otherwise = peek (x-1, y) w + peek (x, y-1) w | |
| where | |
| (x, y) = pos w |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| doom |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE TypeApplications #-} | |
| module Detergo where | |
| import Control.Monad (when) | |
| import Data.List (intercalate) | |
| import Data.Maybe (listToMaybe) | |
| data Level = Low | Medium | High |