This article describes a technique for joining (in an SQL-style) lists of haskell data structures.
Maybe not the fastest, maybe not the smartest, but it works.
| https://www.verbformen.de/konjugation/?w=sein | |
| https://www.verbformen.de/konjugation/?w=haben | |
| https://www.verbformen.de/konjugation/?w=m%C3%BCssen | |
| https://www.verbformen.de/konjugation/?w=k%C3%B6nnen | |
| sein | |
| Präsens Präeteritum | |
| ich bin war | |
| du bist warst | |
| er/es/sie ist war | |
| wir sind waren |
| from ubuntu:latest | |
| run apt-get update && \ | |
| apt-get install -y emacs agda-mode agda-stdlib && \ | |
| apt-get install -y coq coqide && \ | |
| apt-get install -y openssh-server && \ | |
| apt-get install -y iproute2 wget curl && \ | |
| apt-get install -y bzip2 tmux git vim libgmp-dev python3 gcc libtinfo-dev zlib1g-dev xz-utils make && \ | |
| git config --global core.editor vim && \ | |
| git config --global alias.co checkout && \ |
| (This answer pilfers wholesale from [this other answer][1] its example of histomorphism on lists.) | |
| A simple —and not very compelling— example of chronomorphism would be a "safe tail" function for run-length-encoded lists: | |
| tailRunLen :: [(Int,a)] -> Maybe [a] | |
| tailRunLen = chrono alg coalg | |
| where | |
| alg v = case v of | |
| Nil -> Nothing -- empty list | |
| Cons _ (b :< x) -> case x of |
Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x| package com.alexr.dynaenum; | |
| import java.io.*; | |
| import java.lang.reflect.Array; | |
| import java.util.Collection; | |
| import java.util.LinkedHashMap; | |
| import java.util.Map; | |
| <plugin> | |
| <groupId>org.codehaus.cargo</groupId> | |
| <artifactId>cargo-maven2-plugin</artifactId> | |
| <version>1.6.4</version> | |
| <configuration> | |
| <container> | |
| <containerId>tomee7x</containerId> | |
| <dependencies> | |
| <dependency> | |
| <!-- It seems the dependency must also be present, |
| <plugins> | |
| <plugin> | |
| <groupId>org.codehaus.cargo</groupId> | |
| <artifactId>cargo-maven2-plugin</artifactId> | |
| <version>1.6.4</version> | |
| <configuration> | |
| <container> | |
| <containerId>tomcat8x</containerId> | |
| <!-- | |
| <type>embedded</type> |
| module Main where | |
| import Pipes | |
| import qualified Pipes.Prelude as P | |
| import qualified Pipes.Group as PG | |
| import qualified Pipes.ByteString as PB | |
| import qualified Pipes.Text as PT | |
| import Pipes.Text.Encoding (utf8) | |
| import qualified Control.Foldl as L | |
| import qualified Control.Foldl.Text as LT |
| {-# LANGUAGE ConstraintKinds #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| module Soapy (IsRecord) where | |
| import GHC.TypeLits (Symbol) | |
| import Generics.SOP | |
| import qualified Generics.SOP.Type.Metadata as T | |
| type IsRecord (r :: *) (mn :: Symbol) (dn :: Symbol) (cn :: Symbol) (fs :: [T.FieldInfo]) (xs :: [*]) = | |
| (IsProductType r xs, DatatypeInfoOf r ~ T.ADT mn dn '[T.Record cn fs], T.DemoteFieldInfos fs xs) |