Here's an ADT which is not a GADT, in Haskell:
data Expr = IntExpr Int | BoolExpr BoolNo need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.
gpg --list-secret-keys and look for sec, use the key ID for the next stepgit to use GPG -- replace the key with the one from gpg --list-secret-keys| # TextMate tutorial: http://manual.macromates.com/en/language_grammars | |
| # Regex to convert keys to unquoted: '(include|match|captures|begin|end|beginCaptures|endCaptures|name|patterns|0|1|2|3|4|5|6|7|8|9|comment|fileTypes|scopeName|repository|contentName|firstLineMatch|foldingStartMarker|foldingStopMarker)': | |
| scopeName: 'source.<scope>' # <scope> should be a short, unique indicator for the language ("js", "php", "c", etc.) | |
| name: '<name>' # The title that will show up in grammar selection and on your status bar. | |
| fileTypes: [ # An array of file extensions. | |
| 'txt' | |
| 'exif' | |
| ] |
During the fives episode of the [scalaprofies podcast][SP] the two Speaker where questioning for a special string interpolation that shows the definition of parts instead of evaluated result of the expressions. Invalid expressions should be still rejected by the compiler and refactoring tools should also affect the expressions within the string interpolation. Here we will implement such a functionality and see the tip of the of the iceberg of macros and string interpolation.
Example:
scala> def f(x: Int) = x * 2| # In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env | |
| # variable pointing GPG to the gpg-agent socket. This little script, which must be sourced | |
| # in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start | |
| # gpg-agent or set up the GPG_AGENT_INFO variable if it's already running. | |
| # Add the following to your shell init to set up gpg-agent automatically for every shell | |
| if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then | |
| source ~/.gnupg/.gpg-agent-info | |
| export GPG_AGENT_INFO | |
| else |
| {-# LANGUAGE OverloadedStrings #-} | |
| import Text.Pandoc.JSON | |
| import System.Directory | |
| import System.FilePath ((</>)) | |
| import qualified Data.Hash.MD5 as MD5 | |
| import qualified Data.Text as T | |
| import System.IO.Temp | |
| import System.Process | |
| import Control.Monad (unless) |
| import java.util.concurrent.ThreadPoolExecutor.AbortPolicy | |
| import java.util.concurrent._ | |
| import scala.concurrent.{ Promise, Future } | |
| import scala.concurrent.duration.FiniteDuration | |
| import scala.language.implicitConversions | |
| import scala.util.Try | |
| object ScheduledExecutor { | |
| private val defaultHandler: RejectedExecutionHandler = new AbortPolicy |
| #!/usr/bin/env bash | |
| size=1024 # MB | |
| mount_point=$HOME/tmp | |
| name=$(basename "$mount_point") | |
| usage() { | |
| echo "usage: $(basename "$0") [mount | umount | remount | check | orphan]" \ | |
| "(default: mount)" >&2 | |
| } |