Jobs Puzzle in Curry
Implementation of theby Sebastian Fischer, January 2015
Verbal problem description
There are four people: Roberta, Thelma, Steve, and Pete.
by Sebastian Fischer, January 2015
There are four people: Roberta, Thelma, Steve, and Pete.
Die RubyKara Erweiterung aus Kiel gibt es jetzt hier: https://github.com/sebfisch/rubykara-kiel |
Fred: So, you know Darcs?
Lisa: Sure.
Fred: I heard it is quite flexible in managing patches. Wanna show me?
Lisa: Ok, let's make a new repository for some imaginary project.
{- | |
A German blog post translating Java code for the build tool Ant to Scala | |
http://funktionale-programmierung.de/2013/02/26/scala-java-ant.html | |
made me translate the Scala code to Haskell. I added combinators for binary | |
composition of mappers as well as a unit mapper for one of them. The code is | |
still shorter. I find the Haskell version more readable because expressions | |
and their types are separate rather than interleaved as in Scala. |
Currently, Snap and Yesod are the two most active web frameworks for Haskell. In this document, I compare the template languages used by those frameworks for generating HTML.
Both template languages let programmers write markup directly in a markup language rather than generating it from within Haskell. Compared with static HMTL, template languages support substitution to dynamically determine parts of the content of the generated page.
[Heist] and [Hamlet] support different constructs to generate content dynamically. They also differ regarding their syntax for static content.
#!/bin/bash | |
# Replaces classes in Android Package Files | |
# (c) Sebastian Fischer, CC-BY | |
# Can be used to rebuild an App with a modified version of a used library, | |
# as required for closed works that link to an LGPL library. | |
# Depends on: https://code.google.com/p/dex2jar/ |
Delimited continuations manipulate the control flow of programs. Similar to control structures like conditionals or loops they allow to deviate from a sequential flow of control.
We use exception handling as another example for control flow manipulation and later show how to implement it using delimited continuations. Finally, we show that nondeterminism can also be expressed using delimited continuations.
module ListTransformer where | |
import Control.Applicative | |
import Control.Arrow | |
import Control.Category | |
import Prelude hiding ( id, (.) ) | |
data ListConsumer a b | |
= Done b |
tyFun : Set -> Set -> Set; | |
tyFun A T = A -> T; | |
using (G:Vect Set n) { | |
data Expr : Vect Set n -> Set -> Set where | |
Var : (i:Fin n) -> Expr G (vlookup i G) | |
| Val : T -> Expr G T | |
| Lam : Expr (A::G) T -> Expr G (tyFun A T) -- using `A -> T` directly fails | |
| App : Expr G (A -> T) -> Expr G A -> Expr G T |
{- | |
example from | |
http://blog.downstairspeople.org/2010/06/14/a-brutal-introduction-to-arrows/ | |
rewritten using Applicative instance from | |
http://cdsmith.wordpress.com/2011/07/30/arrow-category-applicative-part-i/ |