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 Main where | |
main = print "woei" |
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
foldr1With :: Foldable1 f => (a -> b -> b) -> (a -> b) -> f a -> b | |
foldr1With f b = go . toNonEmpty | |
where | |
go (x :| xs) = case NonEmpty.nonEmpty xs of | |
Nothing -> b x | |
Just xs' -> x `f` (go xs') |
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
import qualified Data.Set as Set | |
import Test.QuickCheck | |
import Debug.Trace | |
setOf :: (Ord a, Show a) => Int -> Gen a -> Gen (Set.Set a) | |
setOf n g = buildSet mempty <$> infiniteListOf g | |
where | |
buildSet s xs | traceShow (take 10 xs) False = undefined | |
buildSet s (x:xs) | length s == n = s |
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
frank@UU# stack install -v | |
Version 1.5.1 x86_64 | |
Compiled with: | |
- Cabal-1.24.2.0 | |
- Glob-0.8.0 | |
- HUnit-1.6.0.0 | |
- MonadRandom-0.5.1 | |
- QuickCheck-2.10.1 | |
- SHA-1.6.4.2 | |
- StateVar-1.1.0.4 |
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
frank@UU# rm -rf ~/.stack | |
frank@UU# stack setup | |
Writing implicit global project config file to: /home/frank/.stack/global-project/stack.yaml | |
Note: You can change the snapshot via the resolver field there. | |
Using latest snapshot resolver: lts-9.10 | |
Downloaded lts-9.10 build plan. | |
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/ | |
Downloading root | |
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/ | |
Downloading timestamp |
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 OverloadedLabels #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
module Main where | |
import Control.Exception (catch) | |
import Control.Monad (forM_) | |
import Control.Monad.IO.Class (MonadIO) | |
import Control.Monad.Trans.Reader (runReaderT) | |
import Data.GI.Base |
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 OverloadedLabels #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
module Main where | |
import Control.Exception (catch) | |
import Control.Monad (forM_) | |
import Control.Monad.IO.Class (MonadIO) | |
import Control.Monad.Trans.Reader (runReaderT) | |
import Data.GI.Base |
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 OverloadedLabels #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
module Main where | |
import Control.Exception (catch) | |
import Control.Monad (forM_) | |
import Control.Monad.IO.Class (MonadIO) | |
import Control.Monad.Trans.Reader (runReaderT) | |
import Data.GI.Base |
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 UnicodeSyntax #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE DataKinds #-} | |
module CoRecExtra where | |
import Data.Maybe(isJust, mapMaybe, listToMaybe, fromJust) | |
import Data.Proxy | |
import Data.Vinyl.Core | |
import Data.Vinyl.Functor | |
import Data.Vinyl.Lens |
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
-- type Height = Int | |
data SkewTree a = Empty | |
| InternalNode !(SkewTree a) a !(SkewTree a) | |
| TopNode !(SkewTree a) a !(SkewTree a) !(SkewTree a) | |
deriving (Show,Eq) | |
leaf a = InternalNode Empty a Empty |
NewerOlder