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
| using System; | |
| namespace MaybeCSharp | |
| { | |
| interface IMaybe<T> | |
| { | |
| IMaybe<U> Bind<U>(Func<T, IMaybe<U>> f); | |
| IMaybe<U> Map<U>(Func<T, U> f); | |
| IMaybe<U> Ap<U>(IMaybe<Func<T, U>> f); | |
| } |
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
| /* | |
| GNU GENERAL PUBLIC LICENSE | |
| Version 3, 29 June 2007 | |
| Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | |
| Everyone is permitted to copy and distribute verbatim copies | |
| of this license document, but changing it is not allowed. | |
| Preamble |
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
| ### Keybase proof | |
| I hereby claim: | |
| * I am bruno-cadorette on github. | |
| * I am brunocadorette (https://keybase.io/brunocadorette) on keybase. | |
| * I have a public key ASDpLETUCCZ5yGWHBeGCTPt9d-RKxIOW9NeZIYe1nvICNgo | |
| To claim this, I am signing this object: |
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 TypeFamilies, DeriveFunctor #-} | |
| import Data.Functor.Foldable | |
| data Tree a = Leaf | Node a (Tree a) (Tree a) deriving (Show) | |
| data TreeF a b = LeafF | NodeF a b b deriving (Functor, Show) | |
| type instance Base (Tree a) = TreeF a | |
| instance Recursive (Tree a) where | |
| project Leaf = LeafF |
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
| Require Import Coq.Lists.List. | |
| Import Coq.Lists.List.ListNotations | |
| Fixpoint my_remove_last {A : Type} (l : list A) : list A:= | |
| match l with | |
| | [] => [] | |
| | x :: [] => [] | |
| | x :: xs => x :: (my_remove_last xs) | |
| end. |
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 Control.Applicative | |
| import qualified Data.Map as Map | |
| import Debug.Trace | |
| import Data.Foldable | |
| import Data.Maybe | |
| import Data.Ord | |
| import Data.List | |
| import Data.List.NonEmpty (nonEmpty) | |
| minTransitions :: |
OlderNewer