Created
January 29, 2014 18:04
-
-
Save coreyoconnor/8693470 to your computer and use it in GitHub Desktop.
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 ExistentialQuantification, DeriveDataTypeable #-} | |
module Main where | |
import Data.Typeable | |
data Highlighter cache syntax = SynHL {hlFocus :: Int -> cache -> cache} | |
data HLState syntax = forall cache. HLState !(Highlighter cache syntax) !cache | |
data BufferImpl syntax = | |
FBufferData { hlCache :: !(HLState syntax) } | |
deriving Typeable | |
focusAst :: Int -> BufferImpl syntax -> BufferImpl syntax | |
focusAst r b@FBufferData {hlCache = HLState s@(SynHL {hlFocus = foc}) cache} = b {hlCache = HLState s (foc r cache)} | |
main = return () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment