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
| <?php | |
| /** | |
| * The Bleb PHP Framework | |
| * | |
| * @author Justin Poliey <jdp34@njit.edu> | |
| * @copyright BlebCT 2010 | |
| * @package bleb | |
| */ | |
| namespace Bleb { |
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 MultiParamTypeClasses #-} | |
| module Main where | |
| import Reactive -- see http://gist.github.com/643798 | |
| data Operation = Push Double | |
| | Drop | |
| | Add | |
| | Subtract |
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 MultiParamTypeClasses #-} | |
| module Reactive (Reaction(beginning), Reactive(react), simulate) where | |
| class Reaction r where | |
| beginning :: r | |
| class (Reaction r) => Reactive r e where | |
| react :: r -> e -> r |
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
| main = interact prg | |
| prg :: String -> String -- pure function! | |
| prg s = unlines $ [ "What is your name?" | |
| , "Hi, " ++ name ++ "!" | |
| , "Where do you live?" | |
| , place ++ " is very nice, isn't it?" ] | |
| ++ re 2 (lns !! 2) | |
| where lns = lines s |
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
| <?php | |
| class Base{ | |
| protected $x; | |
| public function getX(){ | |
| return $this->x;}} | |
| /** | |
| * This class tries to ensure that $x is always an integer. |
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
| def fibFast1(num: Int): BigInt = { | |
| var a: BigInt = 1 | |
| var b: BigInt = 0 | |
| var c: BigInt = 1 | |
| for(bit <- bits(num)){ | |
| bit match { | |
| case 1 => { | |
| a = (a+c)*b | |
| b = b*b + c*c | |
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| namespace Fracture | |
| /// Agent alias for MailboxProcessor | |
| type Agent<'a> = MailboxProcessor<'a> | |
| /// One of three messages for our Object Pool agent | |
| type PoolMessage<'a> = | |
| | Get of AsyncReplyChannel<'a> | |
| | Count of AsyncReplyChannel<int> | |
| | Put of '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
| type ¬[A] = A => Nothing | |
| type ∨[T, U] = ¬[¬[T] with ¬[U]] | |
| type ¬¬[A] = ¬[¬[A]] | |
| type |∨|[T, U] = { type λ[X] = ¬¬[X] <:< (T ∨ U) } | |
| class FoldUnion[T](t: T) { | |
| def boxClass(x: java.lang.Class[_]): java.lang.Class[_] = x.toString match { | |
| case "byte" => manifest[java.lang.Byte].erasure | |
| case "char" => manifest[java.lang.Character].erasure | |
| case "short" => manifest[java.lang.Short].erasure |
OlderNewer