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 TemplateHaskell #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
module Experiment where | |
import Control.Lens | |
import Control.Lens.TH (makeClassyPrisms) | |
import Control.Monad.Error.Class |
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
Laws checking for quickcheck. | |
toText :: Text1 -> Text | |
Heyting algebra | |
cabal2nix as a nix expression | |
Morgan's debugA | |
Extra combinator in `loops` package. | |
Configurator needs interpolation in integer fields. |
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
let | |
nixpkgs = import ./nixpin.nix { }; | |
compiler = "default"; | |
inherit (nixpkgs) pkgs; | |
sources = { | |
text1 = pkgs.fetchFromGitHub { | |
owner = "qfpl"; |
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
{ mkDerivation, aeson, aeson-pretty, base, blaze-html, bytestring | |
, data-default, either, free, lens, optparse-applicative | |
, QuickCheck, semigroups, stdenv, system-filepath, tasty | |
, tasty-hunit, tasty-quickcheck, text, text1, time, url | |
, xml-conduit, xml-conduit-decode | |
}: | |
mkDerivation { | |
pname = "brazil"; | |
version = "0.1.0.0"; | |
src = ./.; |
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
{}: | |
let | |
nixpkgs = import ./nixpin.nix { }; | |
sources = { | |
text1 = nixpkgs.fetchFromGitHub { | |
owner = "qfpl"; | |
repo = "text1"; | |
rev = "a6ec5284a6320f160c9fc749b7a5472e8c122da5"; |
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
module FreeDom where | |
import Control.Monad.Free | |
import Control.Monad.Free.Trans | |
import DOM | |
import DOM.HTML | |
import DOM.HTML.Window | |
import DOM.Node.Node | |
import DOM.Node.Types | |
import Data.Array |
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
Proof of the functor laws for the Maybe functor | |
fmap :: (a -> b) -> Maybe a -> Maybe b | |
fmap f (Just x) = Just (f x) | |
fmap f Nothing = Nothing | |
Prove: | |
fmap id = id | |
Case 1: Just x |
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
import java.util.function.Function; | |
public class Blah { | |
private Blah() { | |
} | |
static class A { | |
} |
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
Higher-kinded types in Java | |
=========================== | |
If we consider that types classify values, then kinds classify types. | |
To use Haskell notation, simple java types are of kind * - the kind of types of values. | |
Generic types (e.g. List) are of kind * -> * - this is essentially a type-level | |
function - pass a type parameter A to the List type constructor and you get a List<A>. | |
Higher-kinded types are (basically) of kind (* -> *) -> *. |
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
package com.example; | |
public abstract class Either<A, B> { | |
public abstract <T> T fold(final F<A, T> af, final F<B, T> bf); | |
private Either(){} | |
public static <A, B> Either<A, B> a(final A a) { | |
return new Either<A, B>() { |
NewerOlder