Before talking about monads, we should review 3 concepts:
They appear in the form f :: a -> b, where :: indicates the type of f.
| Red [ | |
| Title: "Download links" | |
| ] | |
| args: system/script/args | |
| comment { | |
| - Accept a URL as input to program | |
| - HTTP GET URL | |
| - Parse response as HTML | |
| - Extract a links |
| // ==UserScript== | |
| // @name Google Bookmarks fix | |
| // @match https://www.google.com/bookmarks/* | |
| // @grant none | |
| // @require https://code.jquery.com/jquery-1.12.4.min.js | |
| // @require https://code.jquery.com/ui/1.12.1/jquery-ui.js | |
| // ==/UserScript== | |
| $(function() { | |
| try { |
| cat data/data/com.termux/files/home/.bash_profile | |
| if [ -d "$HOME/bin" ] ; then | |
| PATH="$HOME/bin:$PATH" | |
| fi | |
| export SVDIR="$HOME/etc/sv" | |
| mkdir -p $PREFIX/var/run | |
| mkdir -p ~/.log | |
| daemonize -c $PREFIX -l $PREFIX/var/run/runsvdir.lock -p $PREFIX/var/run/runsvdir.pid $PREFIX/bin/applets/runsvdir $SVDIR 2>/dev/null||: |
Disclaimer 1: Type classes are great but they are not the right tool for every job. Enjoy some balance and balance to your balance.
Disclaimer 2: I should tidy this up but probably won’t.
Disclaimer 3: Yeah called it, better to be realistic.
Type classes are a language of their own, this is an attempt to document features and give a name to them.
| {-# LANGUAGE TypeApplications #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE UndecidableInstances #-} | |
| import Data.Singletons | |
| import Data.Promotion.Prelude |
| name: Booking | |
| version: 0.1.0.0 | |
| synopsis: Handling a reservation request in Haskell. Proof of concept | |
| description: Please see README.md | |
| homepage: https://gist.github.com/ploeh/c999e2ae2248bd44d775 | |
| license: MIT | |
| license-file: LICENSE | |
| author: Mark Seemann | |
| maintainer: example@example.com | |
| copyright: 2016 Mark Seemann |
| module ApiModel where | |
| import Data.Time (ZonedTime(..), parseTimeM, defaultTimeLocale, iso8601DateFormat) | |
| data ReservationRendition = ReservationRendition | |
| { rDate :: String | |
| , rName :: String | |
| , rEmail :: String | |
| , rQuantity :: Int } | |
| deriving (Eq, Show, Read) |
| # Set these options in your config.fish (if you want to :]) | |
| # | |
| # set -g theme_display_user yes | |
| # set -g theme_hostname never | |
| # set -g theme_hostname always | |
| # set -g default_user your_normal_user | |
| # Backward compatibility |