Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am abailly on github.
  • I am dr_c0d3 ( on keybase.
  • I have a public key ASD86WDkjx0YyL2R82hHkE2LJzHfpWcJDjCD7oYVnt33Xgo

To claim this, I am signing this object:

||| A proof of the validity of matching algorithm for
||| regular expressions
||| From
module re
import Decidable.Equality
%default total
module Substitution where
import Data.Maybe
import Data.List(findIndex)
newtype Message = Msg { unMsg :: [Int] }
deriving (Eq, Show)
type SubstitutionTable = Int -> Int
module Subway where
import Control.Arrow((>>>))
import Data.List(sort)
data Subway = Sub [Subway]
deriving (Show, Eq, Ord)
fromString' :: [Subway] -> String -> Subway
{-# LANGUAGE DeriveFunctor #-}
module Main where
import Data.List(group, sort)
data Tree a = E | N a (Tree a) (Tree a)
deriving (Eq, Ord, Show, Functor)
insert :: (Ord a) => [a] -> Tree a
insert list = insert' list E
package org.jparsec.examples.dsl;
import org.jparsec.Parser;
import org.jparsec.Parsers;
import org.jparsec.Scanners;
import org.jparsec.Terminals;
import java.util.Arrays;
public class DSL {
||| A proof of the validity of matching algorithm for
||| regular expressions
||| From
module re
%default total
infix 7 .|
infix 6 ..
{-# LANGUAGE DeriveDataTypeable, DeriveGeneric, FlexibleContexts, FlexibleInstances, MultiParamTypeClasses, PolyKinds,
ScopedTypeVariables, TypeFamilies, TypeOperators, UndecidableInstances #-}
module Gorilla.Auth.Roles where
import Control.Monad.Trans (liftIO)
import Control.Monad.Trans.Except (runExceptT)
import Data.Proxy (Proxy (Proxy))
import Data.Typeable (Typeable)
import GHC.Generics (Generic)
import Network.Wai (Request)
abailly / Parking.idr
Last active March 18, 2019 15:04
A first cut at modelling Parking fare problem
||| From Slack ADL:
||| Goal is to "embed" the business rules for computing parking durations inside Idris,
||| computing a pricing expression as the type of a given duration
module Parking
import Data.List
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}