I hereby claim:
- I am mchakravarty on github.
- I am tacticalgrace (https://keybase.io/tacticalgrace) on keybase.
- I have a public key whose fingerprint is 234C FFAE 8B87 C024 2C6B 8DD4 888F 3E64 4E8B F866
To claim this, I am signing this object:
// Put this into an Xcode 12.0 multiplatform app | |
import SwiftUI | |
struct ContentView: View { | |
@State var text = "Hello!" | |
var body: some View { | |
VStack { | |
TextEditor(text: $text) |
infix operator ?! { } | |
func ?!<A>(v: A?, msg: String) -> A { | |
if let v = v { | |
return v | |
} else { | |
println(msg) | |
exit(1) | |
} | |
} |
I hereby claim:
To claim this, I am signing this object:
Prerequisites: OS X with the latest Xcode and command line tools installed (or just the command line tools)
(If you haven't got a machine with OS X, please pair up with a participant who has got a Mac at the workshop.)
Install the Haskell Platform (2013.2.0.0, 64 bit): http://www.haskell.org/platform/mac.html (Note the special installation instructions for using the Haskell Platform with Xcode 5.)
Now, that you have got a Haskell system, install language-c-inline
, the library implementing inline C code for Haskell.
"/usr/bin/ghc" -M -static -H32m -O -Werror -Wall -H64m -O0 -package-db libraries/bootstrapping.conf -package-name Cabal-1.18.0 -hide-all-packages -i -ilibraries/Cabal/Cabal/. -ilibraries/Cabal/Cabal/dist-boot/build -ilibraries/Cabal/Cabal/dist-boot/build/autogen -Ilibraries/Cabal/Cabal/dist-boot/build -Ilibraries/Cabal/Cabal/dist-boot/build/autogen -Ilibraries/Cabal/Cabal/. -optP-include -optPlibraries/Cabal/Cabal/dist-boot/build/autogen/cabal_macros.h -package array-0.4.0.1 -package base-4.6.0.1 -package bytestring-0.10.0.2 -package containers-0.5.0.0 -package deepseq-1.3.0.1 -package directory-1.2.0.1 -package filepath-1.3.0.1 -package pretty-1.1.1.0 -package process-1.1.0.2 -package time-1.4.0.1 -package unix-2.6.0.1 -Wall -fno-ignore-asserts -fwarn-tabs -XHaskell98 -XCPP -fno-warn-deprecated-flags -no-user-package-db -rtsopts -w -odir libraries/Cabal/Cabal/dist-boot/build -hidir libraries/Cabal/Cabal/dist-boot/build -stubdir libraries/Cabal/Cabal/dist-boot/build -dep-makefile libraries/Cabal/Ca |
data PreExp exp = Val Int | |
| Add exp exp | |
newtype Exp = Exp (PreExp Exp) -- this is just a normal expression | |
data AttrExp = AttrExp Attr (PreExp AttrExp) -- an attributed expression | |
data Attr = ... |
{-# LANGUAGE GADTs, DataKinds, KindSignatures, StandaloneDeriving #-} | |
module BezierVec (bezier) where | |
infixr ::: | |
-- encoding of natural numbers (zero and successor of a natural) | |
data Nat = Z | S Nat | |
-- indexed vectors are lists whose first type argument encodes the length of the list |
{-# LANGUAGE TemplateHaskell, QuasiQuotes #-} | |
module TestInlineObjC (objc_initialise, dumpURL) where | |
import Language.C.Quote.ObjC | |
import InlineObjC | |
objc_import ["<Foundation/Foundation.h>"] | |
dumpURL :: String -> IO () | |
dumpURL urlString | |
= do | |
{ urlData <- $objc 'urlString [cstm| { | |
return [NSString stringWithContentsOfURL: [NSURL urlWithString: urlString] | |
encoding: NSUTF8StringEncoding | |
error: NULL]; | |
} |] | |
; putStr urlData | |
} |
Drift is an always-already versioned, cloud-backed text editor. You can use it to take notes, and save them in the GitHub cloud.
Your gists are always saved locally, and any changes you make will get pushed to GitHub's servers.
To name a gist, touch its name in the toolbar.
You can use the share button at the top-right to copy a link to one of your gists, or view it on the web in Safari.