Skip to content

Instantly share code, notes, and snippets.

View diegoeche's full-sized avatar

Diego Echeverri diegoeche

View GitHub Profile
main = do
x <- getLine
putStrLn $ reverse x
main' = (liftM reverse >=> putStrLn) $ getLine
main'' = getLine >>= (putStrLn . reverse)
main = do
x <- getLine
putStrLn $ reverse x
main' = (liftM reverse >=> putStrLn) $ getLine
main'' = getLine >>= (putStrLn . reverse)
main''' = (reverse `liftM` getLine) >>= putStrLn
X/*
X * line3d was dervied from DigitalLine.c published as "Digital Line Drawing"
X * by Paul Heckbert from "Graphics Gems", Academic Press, 1990
X *
X * 3D modifications by Bob Pendleton. The original source code was in the public
X * domain, the author of the 3D version places his modifications in the
X * public domain as well.
X *
X * line3d uses Bresenham's algorithm to generate the 3 dimensional points on a
X * line from (x1, y1, z1) to (x2, y2, z2)
#include <stdio.h>
#include <iostream>
#include <cstdio>
#include <GL/glut.h>
using namespace std;
int x1, x2, y1, y2, z1, z2 = 0;
void point3d(int x, int y, int z) {
class BuildList r where
type Build r :: * -> *
build' :: [a] -> a -> Build r a
instance BuildList a [a] where
type Build [a] = [a]
build' l x = reverse $ x:l
instance BuildList a r => BuildList a (a -> r) where
build' l x = \ y -> build'(x:l) y
> {-# OPTIONS -fglasgow-exts #-}
>
> module VarArg where
> import Data.FiniteMap -- for an example below
>
> class BuildList a r | r-> a where
> build' :: [a] -> a -> r
>
> instance BuildList a [a] where
> build' l x = reverse$ x:l
[<JavaScriptType>]
type Test =
inherit Web.Control
new () = {}
[<JavaScript>]
override this.Body =
let container = Div [ StyleAttribute "width:500px; height:300px;" ]
if Google.Maps.Base.BrowserIsCompatible() |> not then
JavaScript.window.alert "Your browser is not compatible with Google Maps"
else
/// The color of the axis.
/// Possible values are as those of the <a href="#backgroundColor">backgroundColor</a> configuration option.
/// Default Value: default color
axisColor : obj(*string or Object*)
/// The border around axis background.
/// Possible values are as those of the <a href="#backgroundColor">backgroundColor</a> configuration option.
/// Default Value: default color
axisBackgroundColor : obj(*string or Object*)
/// Font size of the chart axis text, in pixels.
/// Default Value: automatic
/// The color of the axis.
/// Possible values are as those of the <a href="#backgroundColor">backgroundColor</a> configuration option.
/// Default Value: default color
axisColor : obj(*string or Object*)
/// The border around axis background.
/// Possible values are as those of the <a href="#backgroundColor">backgroundColor</a> configuration option.
/// Default Value: default color
axisBackgroundColor : obj(*string or Object*)
/// The lowest value for a range marked by a green color.
///
/// Default Value: none
greenFrom : float
/// The highest value for a range marked by a green color.
///
/// Default Value: none
greenTo : float