This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Pattern Matching in Records | |
Let us pattern match {first:string,second:string,third:string} | |
*) | |
(*You should not code like this. | |
This code will produce a type of val test = fn : {a:'a, b:'b, c:'c} -> {first:'a, second:'b, third:'c} | |
So, it creates actually records with fields of a, b and c. This is not what you want. | |
*) | |
fun test e = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery.min.js"></script> | |
<link href="http://getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet" type="text/css" /> | |
<script src="http://getbootstrap.com/dist/js/bootstrap.js"></script> | |
<link href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.min.css" rel="stylesheet" type="text/css" /> | |
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script> | |
<link href="./jquery.jqplot.min.css" rel="stylesheet" | |
type="text/css" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Applicative | |
data Tree a = Leaf a | |
| Node (Tree a) (Tree a) | |
deriving Show | |
instance Functor Tree where | |
fmap f (Leaf a) = Leaf (f a) | |
fmap f (Node x y) = Node (fmap f x) (fmap f y) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cabal install -v3 --only-dependencies | |
Searching for ghc in path. | |
Found ghc at /usr/bin/ghc | |
("/usr/bin/ghc",["--numeric-version"]) | |
/usr/bin/ghc is version 7.6.2 | |
looking for tool ghc-pkg near compiler in /usr/bin | |
found ghc-pkg in /usr/bin/ghc-pkg | |
("/usr/bin/ghc-pkg",["--version"]) | |
/usr/bin/ghc-pkg is version 7.6.2 | |
("/usr/bin/ghc",["--supported-languages"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configuration file for ipython. | |
c = get_config() | |
#------------------------------------------------------------------------------ | |
# InteractiveShellApp configuration | |
#------------------------------------------------------------------------------ | |
# A Mixin for applications that start InteractiveShell instances. | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install package `auctex-11.88.6'? (y or n) y | |
Contacting host: elpa.gnu.org:80 [2 times] | |
Parsing tar file...done | |
Extracting auctex-11.88.6/ | |
Extracting auctex-11.88.6/tex-site.el | |
Wrote /home/sibi/.emacs.d/elpa/auctex-11.88.6/tex-site.el | |
Extracting auctex-11.88.6/tests/ | |
Extracting auctex-11.88.6/tests/latex/ | |
Extracting auctex-11.88.6/tests/latex/latex-test.el | |
Wrote /home/sibi/.emacs.d/elpa/auctex-11.88.6/tests/latex/latex-test.el |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE EmptyDataDecls #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE QuasiQuotes #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeFamilies #-} | |
import Control.Monad.IO.Class (liftIO) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
these derivations will be built: | |
/nix/store/hjl2pj0l8hp4q8qjdz25ysa3zpgdn6f8-ghc-7.10.2.drv | |
building path(s) ‘/nix/store/xcskd8vlbfalyj45az1c3x44wv0fgzby-ghc-7.10.2’ | |
collision between `/nix/store/9ch1py7iv3id2fyn0rz0sd28sdhhgnlq-persistent-2.2/lib/ghc-7.10.2/persistent-2.2.2/libHSpersistent-2.2.2-JLgfajdmTC3AD8guoyGkEF-ghc7.10.2.so' and `/nix/store/dzlk7m2gs0jd89f69vbyfph2v7daxslv-persistent-2.2.2/lib/ghc-7.10.2/persistent-2.2.2/libHSpersistent-2.2.2-JLgfajdmTC3AD8guoyGkEF-ghc7.10.2.so' | |
builder for ‘/nix/store/hjl2pj0l8hp4q8qjdz25ysa3zpgdn6f8-ghc-7.10.2.drv’ failed with exit code 2 | |
error: build of ‘/nix/store/hjl2pj0l8hp4q8qjdz25ysa3zpgdn6f8-ghc-7.10.2.drv’ failed | |
/home/sibi/.nix-profile/bin/nix-shell: failed to build all dependencies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE PackageImports #-} | |
{-# LANGUAGE QuasiQuotes #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE RecordWildCards #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ghcvm.oldtime; | |
import java.util.Date; | |
import java.util.Calendar; | |
import java.util.TimeZone; | |
import java.text.SimpleDateFormat; | |
public class Utils { | |
public static long getClockTimePrim() { |