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 MyPrelude | |
| ( module Prelude | |
| , (|>), (<|) | |
| ) where | |
| import Prelude | |
| infixr 0 apply as |> | |
| infixl 1 applyFlipped as <| |
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
| -- | Type level Peano numbers in PureScript. | |
| module Main where | |
| import Prelude hiding (zero,one,add) | |
| import Effect (Effect) | |
| import Effect.Console (log) | |
| foreign import kind Peano |
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
| use std::collections::HashMap; | |
| use std::env; | |
| // Alias some types | |
| type Count = HashMap<String, usize>; | |
| type ParseError = String; | |
| /// Take a list of tuples of strings and counts and | |
| /// convert them into a hash table. | |
| fn make_count(tpls: Vec<(String, usize)>) -> Count { |
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
| ;;; vrl-mode.el --- Major mode for Vector Remap Language code -*- lexical-binding: t; -*- | |
| ;; Version: 0.0.1 | |
| ;; Keywords: VRL major mode | |
| ;; Author: Stephen Wakely | |
| ;; Package-Requires: ((emacs "26.1")) | |
| ;; This file is not part of GNU Emacs. | |
| ;; This program is free software; you can redistribute it and/or modify |
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
| trait Functor<A> { | |
| type Res<B>; | |
| fn fmap<B, F: Fn(&A) -> B>(&self, f: F) -> Self::Res<B>; | |
| } | |
| impl<A> Functor<A> for Option<A> { | |
| type Res<B> = Option<B>; | |
| fn fmap<B, F: Fn(&A) -> B>(&self, f: F) -> Self::Res<B> { | |
| match self { |
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
| trait Monad<A> { | |
| type Res<B>; | |
| fn pure(item: A) -> Self; | |
| fn bind<B, F: Fn(&A) -> Self::Res<B>>(&self, f: F) -> Self::Res<B>; | |
| } | |
| impl<A> Monad<A> for Option<A> { | |
| type Res<B> = Option<B>; |
OlderNewer