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 DeriveDataTypeable #-} | |
| import Data.Data | |
| import Data.Generics.PlateData | |
| data Child1 a = Child1 a Int | |
| deriving (Data, Show, Typeable) | |
| data Child2 a = Child2 a String | |
| deriving (Data, Show, Typeable) |
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 PatternGuards #-} | |
| module Main where | |
| import Control.Applicative | |
| import Data.Ord | |
| import Directory | |
| import IO | |
| import List | |
| import Monad | |
| import Network.HTTP |
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
| IEnumerable<int> nums() | |
| { | |
| yield return 1; | |
| foreach (int n in nums()) | |
| yield return n+1; | |
| } |
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
| -- a, ab, abe, al, an, ana, ant, au, ay, b, ba, bag, bar, barn, bc, be, br, bs, c, cc, cf, cher, chere, cr, cs, cw, cy, d, e, ee, eg, envy, er, et, ev, ever, f, fa, ff, fn, fo, fr, ft, fur, fw, g, gh, gl, gp, gr, gum, h, ha, i, if, il, in, ing, iv, j, je, jf, jg, jm, jp, jr, js, jt, jw, k, l, m, marne, mm, mr, my, n, na, nag, nan, nh, nl, no, nor, ny, o, oe, of, on, one, onea, ont, op, or, p, pe, pf, pj, pl, pp, ps, pure, purer, q, r, rail, re, rg, ri, rire, rr, rt, s, sa, sb, se, sg, she, sj, sn, ss, st, t, tc, te, tu, ty, u, un, v, va, vat, vi, vs, vy, w, wc, we, wf, wg, wj, wr, ws, wt, wz, x, y, z, ze | |
| module Main where | |
| import Char | |
| import Control.Applicative | |
| import qualified Data.Set as Set | |
| import List | |
| lowerWords :: String -> [String] |
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
| type Stringer = int -> string;; | |
| let f : Stringer = fun n -> n.ToString();; | |
| f 42;; |
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
| > type DoubleStringer = delegate of int -> int -> string;; | |
| type DoubleStringer = delegate of int -> int -> string;; | |
| -----^^^^^^^^^^^^^^ | |
| stdin(6,6): error FS0950: Delegate specifications must not be curried types. Use 'typ * ... * typ -> typ' for multi-argument delegates, and 'typ -> (typ -> typ)' for delegates returning function values. |
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
| public class Yield : Delegate | |
| { | |
| public Yield Invoke() { /* magic */ } | |
| } |
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
| > let func (a : seq<'a seq>) = 5.;; | |
| val func : seq<seq<'a>> -> float | |
| > let a = [[4.]];; | |
| val a : float list list = [[4.0]] | |
| > func a;; |
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
| 10 PRINT "HELLO" | |
| 20 GOTO 10 |
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
| // Taken from https://github.com/fsharp/fsharp/blob/master/src/fsharp/fscopts.fs | |
| // OptionBlock: Internal options (internal use only) | |
| //-------------------------------------------------- | |
| let testFlag tcConfigB = | |
| CompilerOption("test", tagString, OptionString (fun s -> | |
| match s with | |
| | "ErrorRanges" -> tcConfigB.errorStyle <- ErrorStyle.TestErrors | |
| | "MemberBodyRanges" -> PostTypecheckSemanticChecks.testFlagMemberBody := true |
OlderNewer