This file contains 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 RecursiveDo #-} | |
module Main(main) where | |
import qualified Graphics.UI.Threepenny as UI | |
import Graphics.UI.Threepenny.Core | |
import Graphics.UI.Threepenny.Editors | |
import Data.Profunctor | |
import Language.Haskell.Exts |
This file contains 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 StaticPointers #-} | |
{-# LANGUAGE InstanceSigs #-} | |
{-# LANGUAGE ExistentialQuantification #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
import Data.Binary | |
import Data.Typeable | |
import System.IO.Unsafe | |
import GHC.StaticPtr |
This file contains 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 #-} | |
-- Note that 1 vs -1 is one of the few things that matters!!! | |
import Language.Haskell.Exts | |
import Language.Haskell.Exts.Util | |
import Data.Data | |
import Control.Monad | |
import Data.List |
This file contains 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
-- ghc bug.hs c.c && bug | |
module Main(main) where | |
import Control.Concurrent | |
import Control.Monad | |
import Foreign.C | |
import Foreign.Ptr | |
foreign import ccall apply :: FunPtr (CString -> IO CString) -> CString -> IO CString |
This file contains 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
-- To use: | |
-- Place this file in compiler/.ghci | |
-- stack exec --stack-yaml=../hadrian/stack.yaml -- ghci -package-db=../_build/stage0/bootstrapping.conf | |
:set -ibackpack | |
:set -ibasicTypes | |
:set -icmm | |
:set -icodeGen | |
:set -icoreSyn | |
:set -ideSugar |
This file contains 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 CPP #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving, GADTs, DeriveFunctor, ScopedTypeVariables, BangPatterns #-} | |
module Development.Shake.Internal.Core.Monad( | |
RAW, Capture, runRAW, | |
getRO, getRW, getsRO, getsRW, putRW, modifyRW, | |
catchRAW, tryRAW, throwRAW, | |
unmodifyRW, captureRAW, | |
) where |
This file contains 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 DisambiguateRecordFields #-} | |
import Rec3 | |
import Rec2 | |
bug = AnDouble{an=1} |
This file contains 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
-- Program used to compile LensOpt.hs using the GHC API | |
import GHC | |
import GhcPlugins | |
import GHC.Paths | |
main = runGhc (Just libdir) $ do | |
setTargets [] | |
dflags <- getSessionDynFlags | |
setSessionDynFlags dflags{hscTarget = HscNothing} |
This file contains 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
suspending :: forall i k v. Ord k => Scheduler Monad i i k v | |
suspending rebuilder tasks target store = fst $ execState (build target) (store, Set.empty) | |
where | |
build :: k -> State (Store i k v, Set k) () | |
build key = case tasks key of | |
Nothing -> return () | |
Just task -> do | |
done <- gets snd | |
when (key `Set.notMember` done) $ do | |
value <- gets (getValue key . fst) |
This file contains 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
data Foo where | |
Bar :: Foo | |
Baz :: Foo | |
deriving Show | |
-- seems to be parsed as: | |
data Foo where { | |
Bar :: Foo; | |
Baz :: foo} |