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
-- | 'withLocTH' is a convenient TH macro which expands to 'withLoc' @\<source location\>@ | |
-- It should only be used when the MonadLoc preprocessor is not available. | |
-- Usage: | |
-- | |
-- > f x = $withLocTH $ do | |
-- > $withLocTH $ something | |
-- > x < -$withLocTH $ something-else | |
-- > ... | |
-- |
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
module Data.Evaluated where | |
import Data.Word | |
import GHC.Prim | |
import GHC.Exts | |
import Foreign | |
#include "ghcconfig.h" | |
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
module Expressions where | |
import Data.Map (Map) | |
import Data.Maybe | |
import Text.Printf | |
import qualified Data.Map as Map | |
data ExprF k = Term Int | Op Operator k k | |
deriving (Show, Eq, Functor) |
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
module Expressions where | |
import Data.Map (Map) | |
import Data.Maybe | |
import Text.Printf | |
import qualified Data.Map as Map | |
data ExprF k = Term Int | Op Operator k k | |
deriving (Show, Eq, Functor) |
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
namespace org.jiborra | |
module ObjectModel = | |
open System.Collections | |
open System.Collections.ObjectModel | |
open System.Collections.Generic | |
open System.Collections.Specialized | |
open System.ComponentModel | |
open System.Threading |
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 GADTs #-} | |
> {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} | |
> module Typed where | |
> import Control.Applicative -- (Const(..)) | |
> import Prelude hiding (Left, Right) | |
> import Data.Functor.Identity | |
> import qualified Data.Set as Set | |
> import Data.Set (Set) |
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 TypeFamilies #-} | |
import Data.Enumerator | |
import Data.Monoid | |
e :: Monad m => Enumerator Int m [Int] | |
e = enumList 1 [1..10] | |
enumStream :: Monad m => Stream a -> Enumerator a m b |
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
namespace DU.Json | |
open Microsoft.FSharp.Reflection | |
open Newtonsoft.Json | |
open Newtonsoft.Json.Serialization | |
open System | |
module Exts = | |
type TokenValue = | |
{ typ : JsonToken |
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 RankNTypes #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
{-# LANGUAGE TypeSynonymInstances #-} | |
import Control.Concurrent.Async | |
import Control.DeepSeq |
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 ApplicativeDo, GeneralizedNewtypeDeriving #-} | |
import Data.Functor.Identity | |
import Data.Monoid | |
newtype A x = A (Identity x) deriving (Functor, Applicative) | |
-- ghc 8.0.2 does not accept bad :: A () (no instance for Monad A) | |
bad :: Identity () | |
bad = do |
OlderNewer