This file contains 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
Lua 5.2.2 Copyright (C) 1994-2013 Lua.org, PUC-Rio | |
> print((function () end)()) | |
> a = (function () end)() | |
> print(a) | |
nil |
This file contains 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
{-# OPTIONS_GHC -Wall #-} | |
module ShuntingYard where | |
import qualified Data.Map as M | |
data Op = Op String Prec Assoc | |
| OLParen | ORParen deriving (Show) | |
type Prec = Int |
This file contains 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 LambdaCase, GeneralizedNewtypeDeriving #-} | |
{-# OPTIONS_GHC -Wall #-} | |
import Data.Array.IArray | |
import Debug.Trace | |
stream :: Array Int String | |
stream = listArray (0, length lst - 1) lst | |
where | |
lst = [ "(", "!", "string", "?", "string", ")", "?", "string" ] |
This file contains 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
function fail(reason) | |
return { status = "failure", reason = reason } | |
end | |
function success(ret, idx) | |
return { status = "success", token = ret, new_idx = idx } | |
end | |
function token(tok) | |
return function (stream, idx, cont) |
This file contains 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
[20:25] --> minerva ([email protected]) has joined this channel. | |
[20:25] <minerva> hello all | |
[20:25] <YHWH> yo | |
[20:25] <minerva> i need some advice from some guys | |
[20:26] <YHWH> most of us are guys | |
[20:26] <YHWH> if not lal of us | |
[20:26] <YHWH> all, too | |
[20:26] <minerva> wow | |
[20:26] <minerva> ok den | |
[20:26] <minerva> i had a sort of date last night |
This file contains 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
ghci> putStr $ runProg "main = S K K 3" | |
1) Stk [ 1: NSupercomb main [ ] ] | |
Heap [ 1: NSupercomb main [ ] | |
2: NSupercomb I [ x ] | |
3: NSupercomb K [ x y ] | |
4: NSupercomb K1 [ x y ] | |
5: NSupercomb S [ f g x ] | |
6: NSupercomb compose [ f g x ] | |
7: NSupercomb twice [ f ] ] | |
This file contains 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
diff --git a/CMakeLists.txt b/CMakeLists.txt | |
index a4dcf97..8878284 100644 | |
--- a/CMakeLists.txt | |
+++ b/CMakeLists.txt | |
@@ -557,27 +557,10 @@ if(OPENAL_FOUND) | |
endif() | |
if(NOT ANDROID) | |
- if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | |
- include(FindSDL2 OPTIONAL) |
This file contains 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 MultiParamTypeClasses, | |
FunctionalDependencies, | |
FlexibleInstances #-} | |
class Option a b | a -> b where | |
toOption :: a -> Maybe b | |
instance Option (Maybe a) a where | |
toOption = id |
This file contains 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 NoMonomorphismRestriction #-} | |
module Test where | |
------------------------------------------------------------------------------- | |
import Blaze.ByteString.Builder | |
import Control.Applicative | |
import Control.Monad.Identity | |
import Control.Monad.IO.Class |
This file contains 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
➜ idris git:(master) ✗ diffstat parser.diff | |
Parser.hs | 307 +++++++++++++++++++------------------------------------------- | |
1 file changed, 99 insertions(+), 208 deletions(-) |