Skip to content

Instantly share code, notes, and snippets.

cluster.name: catalog_search
node.name: "Catalog Master"
node.tag: query
bootstrap.mlockall: true
network.publish_host: 127.0.0.1
let sortListsByLength l = sortBy (comparing length) l
sortListsByLength [[1,2],[1,2,3],[1,2,3,4]]
-- => [[1,2],[1,2,3],[1,2,3,4]]
{-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-}
-----------------------------------------------------------------------------
--
-- GHC Driver program
--
-- (c) The University of Glasgow 2005
--
-----------------------------------------------------------------------------
x = 1
main = do
putStrLn (show x)
{-
~ runghc foo.hs
1
[
{
"key": "foo",
"values": [
[ { "0" : 1 },
{ "1" : 21 }
],
[ { "0" : 2 },
{ "1" : 22 }
.container
.charting-area
nvd3-stacked-area-chart(data="chartData"
id="report3"
height="600"
xaxistickformat="xAxisTickFormat()"
yaxistickformat="yAxisTickFormat()"
showxaxis="true"
showyaxis="true")
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<title>Angular.js nvd3.js Line Chart Directive</title>
<meta http-equiv="content-type" content="text/html; charset=UTF8">
<script src="js/angular.js"></script>
<script src="js/d3.js"></script>
<script src="js/nv.d3.js"></script>
<script src="../dist/angularjs-nvd3-directives.js"></script>
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<title>Angular.js nvd3.js Line Chart Directive</title>
<meta http-equiv="content-type" content="text/html; charset=UTF8">
<script src="js/angular.js"></script>
<script src="js/d3.js"></script>
<script src="js/nv.d3.js"></script>
<script src="../dist/angularjs-nvd3-directives.js"></script>
-- mydrop.hs
drop' n x = do
let v = x
let vs = drop' (n-1) x
return (v:vs)
{-
Prelude> :load mydrop.hs
[1 of 1] Compiling Main ( mydrop.hs, interpreted )
mydrop.hs:8:13:
@novodinia
novodinia / control-struct-defs.hs
Last active January 3, 2016 04:19
Cale explaining IO within #haskell
-- twice :: IO a -> IO (a,a)
twice x = do
u <- x
v <- x
return (u,v)
main = do
p <- twice getLine
print p