Use the Dockerfile below to build the Idris 2 executable and standard library:
docker build --tag=idris2 .| C:\Windows\System32\Inetsrv\appcmd.exe set site /site.name: %1 /+bindings.[protocol='http',bindingInformation='*:80:%2'] |
| // 1. Set build action 'Embedded Resourse'. | |
| // 2. Run this handler as early as possible: | |
| AppDomain.CurrentDomain.AssemblyResolve += (sender, args) => | |
| { | |
| string resourceName = "Your.Assembly.Name.Here." + new AssemblyName(args.Name).Name + ".dll"; | |
| using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName)) | |
| { | |
| if (stream == null) |
| // `fix` is an Y-combinator implementation (recursive calls in lambda calculus): | |
| // Y = \f -> (\x -> f (x x))(\x -> f (x x)) | |
| // fix :: (a -> a) -> a | |
| const fix = f => (x => f(y => (x(x))(y)))(x => f(y => (x(x))(y))); | |
| // Generator function. Inner signature should correspond to actual function interface. | |
| // mapgen :: ((a -> b) -> [a] -> [b]) -> (a -> b) -> [a] -> [b] | |
| const mapgen = map => f => list => list.length === 0 ? [] : [f(list[0]), ...map(f)(list.slice(1))]; |
| import { log } from 'fp-ts/lib/Console'; | |
| import { Type, URIS } from 'fp-ts/lib/HKT'; | |
| import { identity, URI as IdURI } from 'fp-ts/lib/Identity'; | |
| import { none, Option, some } from 'fp-ts/lib/Option'; | |
| import { randomInt } from 'fp-ts/lib/Random'; | |
| import { fromIO, Task, task, URI as TaskURI } from 'fp-ts/lib/Task'; | |
| import { createInterface } from 'readline'; | |
| export interface ProgramSyntax<F extends URIS, A> { | |
| map: <B>(f: (a: A) => B) => _<F, B>; |
| import { Functor } from 'fp-ts/lib/Functor'; | |
| import { HKT, Kind3, URIS3 } from 'fp-ts/lib/HKT'; | |
| export type Fn<A, B> = (a: A) => B; | |
| export interface Profunctor<F extends URIS3, G> { | |
| dimap: <A, B>(ab: Fn<A, B>) => <C, D>(cd: Fn<C, D>) => (fbc: Kind3<F, G, B, C>) => Kind3<F, G, A, D>; | |
| } | |
| export type UpStar<F, A, B> = (a: A) => HKT<F, B>; |
| module AppendInjective | |
| import Data.List.Views | |
| %access export | |
| %default total | |
| appendInjectiveRight : (a, b, c : List x) -> a ++ b = a ++ c -> b = c | |
| appendInjectiveRight [] _ _ prf = prf | |
| appendInjectiveRight (_ :: xs) b c prf = appendInjectiveRight xs b c (cong { f = drop 1 } prf) |
| import AbortController from 'abort-controller'; | |
| import { circuitBreaker, defaultBreakerOptions } from 'circuit-breaker-monad/lib'; | |
| import { BreakerClosed, BreakerOpen, BreakerState } from 'circuit-breaker-monad/lib/types'; | |
| import { Either, left } from 'fp-ts/lib/Either'; | |
| import { Lazy } from 'fp-ts/lib/function'; | |
| import { IORef } from 'fp-ts/lib/IORef'; | |
| import fetch from 'node-fetch'; | |
| const fetcher = circuitBreaker<User[]>().run(defaultBreakerOptions); |
| import { Do } from 'fp-ts-contrib/lib/Do'; | |
| import { array } from 'fp-ts/lib/Array'; | |
| import { constUndefined, identity, Lazy } from 'fp-ts/lib/function'; | |
| import { Kind, URIS } from 'fp-ts/lib/HKT'; | |
| import * as Id from 'fp-ts/lib/Identity'; | |
| import { Monad1 } from 'fp-ts/lib/Monad'; | |
| import { none, Option } from 'fp-ts/lib/Option'; | |
| import { Traversable1 } from 'fp-ts/lib/Traversable'; | |
| declare module 'fp-ts/lib/HKT' { |
| export type Either<E, A> = [E, null] | [null, A]; | |
| type Fn<A, B> = (a: A) => B; | |
| export const left = <E, A>(e: E): Either<E, A> => [e, null]; | |
| export const right = <E, A>(a: A): Either<E, A> => [null, a]; | |
| export const isLeft = <E, A>(e: Either<E, A>): e is [E, null] => e[1] === null; | |
| export const isRight = <E, A>(e: Either<E, A>): e is [null, A] => e[0] === null; |