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
diff --git a/compiler/typecheck/TcGenDeriv.lhs b/compiler/typecheck/TcGenDeriv.lhs | |
index 77bda82..1347f14 100644 | |
--- a/compiler/typecheck/TcGenDeriv.lhs | |
+++ b/compiler/typecheck/TcGenDeriv.lhs | |
@@ -171,7 +171,7 @@ gen_Eq_binds loc tycon | |
fall_through_eqn | |
| no_tag_match_cons -- All constructors have arguments | |
= case pat_match_cons of | |
- [] -> [] -- No constructors; no fall-though case | |
+ [] -> [([], undefined_Expr)] -- No constructors; no fall-though case |
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 Data.Profunctor | |
import qualified Data.Set as S | |
import Control.Monad.Trans (liftIO) | |
import Control.Monad.Trans.State | |
type MyMonad r = StateT (S.Set Int) IO r | |
runMyMonad :: MyMonad r -> IO r | |
runMyMonad m = evalStateT m S.empty |
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 Control.Monad.Free | |
data ExprF a k = Lit a | Add k k | |
instance Functor (ExprF a) where | |
fmap f (Lit x) = Lit x | |
fmap f (Add x y) = Add (f x) (f y) | |
type Expr a = Free (ExprF a) () |
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 Queue ( | |
empty | |
, isEmpty | |
, peek | |
, remove | |
, add | |
) where | |
data Queue a = Queue [a] [a] [a] | |
deriving (Eq, Show) |
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
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default" }: | |
let | |
inherit (nixpkgs) pkgs; | |
haskellPackages = if compiler == "default" | |
then pkgs.haskellPackages | |
else pkgs.haskell.packages.${compiler}; |
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
% select(X,HasXs,OneLessXs) deletes a single X from HasXs | |
select(X, [X|Xs], Xs). | |
select(X, [Y|Ys], [Y|Zs]) <- select(X, Ys, Zs). | |
% insert(X,OneLessXs, HasXs) inserts X into OneLessXs at a non-deterministic position | |
insert(X, Ys, Zs) <- select(X, Zs, Ys). | |
% permutation1(Input, Output) | |
% non-deterministically select the head of the output, permute the remaining input and use as the tail | |
permutation1(Xs, [Z|Zs]) <- select(Z,Xs,Ys), permutation(Ys,Zs). |
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
-- Things from reactive-banana in use: | |
-- - stepper | |
-- to accumulate state in a behavior from an inital value and the firings of an event | |
-- - <@> and <@ | |
-- to sample behaviors at the point when an event occurs (with or without the value in the event) | |
-- - whenE | |
-- to filter events based on a Behavior Bool | |
-- - reactimate | |
-- to do IO when an event occurs | |
-- plus leftmost |
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 ScopedTypeVariables #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Run ( | |
runner | |
) where | |
import Control.Monad.Reader (ReaderT, runReaderT) | |
import Data.Foldable (traverse_) |
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 OverloadedStrings #-} | |
{-# LANGUAGE OverloadedLists #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
module Scratch where | |
import Data.Monoid ((<>)) | |
import Control.Monad.Trans (liftIO) | |
import Reflex.Dom.Core |
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
{ config, pkgs, ...}: { | |
services.postfix = { | |
enable = true; | |
setSendmail = true; | |
}; | |
services.postgresql = { | |
enable = true; | |
package = pkgs.postgresql; |
OlderNewer