View Handler.purs
type ExpressM a = forall e. Eff (express :: Express | e) a | |
data HandlerM a = HandlerM (Request -> Response -> ExpressM Unit -> ExpressM a) | |
instance monadEffHandlerM :: MonadEff eff HandlerM where | |
liftEff act = HandlerM \_ _ _ -> unsafeInterleaveEff act |
View Trello.purs
module Trello | |
( BoardId() | |
, Credentials() | |
, Trello() | |
, runTrello | |
, Board() | |
, getBoard | |
) where | |
import Data.Maybe |
View Writer.fs
type Writer<'Result, 'Output> = | |
| W of 'Result * seq<'Output> | |
type WriterBuilder() = | |
member this.Zero() = W ((), Seq.empty) | |
member this.Yield(x) = W (x, Seq.empty) | |
member this.Return(x) = this.Yield(x) | |
member this.Bind(W (a, xs), k) = | |
let (W (b, ys)) = k a | |
W (b, Seq.append xs ys) |
View OnPlatform.fs
Device.OnPlatform <| function | |
| iOS, Tablet -> | |
this.Padding <- Thickness(0, 0, 0, 0) | |
| _ -> () |
View PhotoViewController.fs
open System | |
open MonoTouch.UIKit | |
open Cirrious.FluentLayouts.Touch | |
type PhotoViewController() = | |
inherit UIViewController() | |
let imageViewSize = 200.0f | |
let imageView = | |
let view = UIImageView( |
View HexagonApp.cs
using System.Drawing; | |
using MonoTouch.Foundation; | |
using MonoTouch.UIKit; | |
namespace HexagonApp { | |
[Register ("AppDelegate")] | |
class AppDelegate : UIApplicationDelegate { | |
UIWindow window; | |
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { |
View WhatsForLunch.fs
module MonkeyBot.Plugins.WhatsForLunch | |
open System | |
open DDay.iCal | |
open MonkeyBot | |
let ZeroCaterId = "..." | |
type LunchResponse = | |
| Lunch of string |
View trace.fs
let trace format = flip Printf.ksprintf format <| fun line -> | |
if Environment.GetEnvironmentVariable "DEBUG" = "true" then | |
Console.WriteLine line |
View LoremIpsum.cs
using System; | |
using System.Linq; | |
using System.Collections.Generic; | |
using System.Text.RegularExpressions; | |
namespace Gibberish | |
{ | |
public static class LoremIpsum | |
{ | |
const string Corpus = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent ornare id erat a pellentesque. Integer tincidunt velit odio, molestie varius lorem volutpat at. Sed ultricies ligula orci, congue condimentum libero sollicitudin non. Morbi eget nisl facilisis, semper enim in, lacinia ligula. Etiam felis leo, malesuada non consequat ut, dignissim vitae arcu. Quisque a turpis sodales, dignissim nunc posuere, ornare risus. Nunc vitae ligula porttitor, consectetur odio ut, condimentum ipsum. |
View delegate.cs
using System; | |
namespace Foo | |
{ | |
class MainClass | |
{ | |
static void Go (Action<int> act) | |
{ | |
act (1); | |
} |