Skip to content

Instantly share code, notes, and snippets.

module Ch07a2 where
import Prelude (Unit, discard, show, (==), (<=), (<), (>), (>=), ($))
import Data.Eq (class Eq)
import Data.Ord (class Ord)
import Data.Show (class Show)
import Data.Generic.Rep (class Generic)
import Data.Show.Generic (genericShow)
import Effect (Effect)
import Effect.Console (log)
module Ch07a1 where
import Prelude (Unit, discard, (<>))
import Effect (Effect)
import Effect.Console (log)
-------------------- JS Primitives --------------------------------------------------------
foreign import ordIntImpl :: Ordering -> Ordering -> Ordering -> Int -> Int -> Ordering
foreign import eqIntImpl :: Int -> Int -> Boolean
module Ch05 where
import Prelude (Unit, type(~>), discard, negate, show, otherwise, (+), (-), (<), (>), (<=), (>=), (==), (/=), (<<<))
import Data.List (List(..))
import Data.Maybe (Maybe(..))
import Data.Tuple (Tuple(..), snd)
import Effect (Effect)
import Effect.Console (log)
flip :: ∀ a b c. (a -> b -> c) -> b -> a -> c
// Built with IMPACT - impactjs.org
(function (window) {
"use strict";
Number.prototype.map = function (istart, istop, ostart, ostop) {
return ostart + (ostop - ostart) * ((this - istart) / (istop - istart));
};
Number.prototype.limit = function (min, max) {
return Math.min(max, Math.max(min, this));
};
Number.prototype.round = function (precision) {
@mkohlhaas
mkohlhaas / crosswords.pl
Created July 23, 2020 11:12
Learn Prolog Now! Exercise 2.4
% crossword
word(astante,a,s,t,a,n,t,e).
word(astoria,a,s,t,o,r,i,a).
word(baratto,b,a,r,a,t,t,o).
word(cobalto,c,o,b,a,l,t,o).
word(pistola,p,i,s,t,o,l,a).
word(statale,s,t,a,t,a,l,e).
h1(H1,V1,V2,V3):-