I hereby claim:
- I am lpil on github.
- I am lpil (https://keybase.io/lpil) on keybase.
- I have a public key ASBlAwu7BPPtgNEVS1e2I12YMcjQpOSKHM1_Wz6Sd39YJQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
var elm$core$Basics$never = function (_n0) { | |
never: | |
while (true) { | |
// Stuff here | |
} | |
}; |
defmodule Web do | |
require Logger | |
@behaviour :elli_handler | |
def handle(r, _args) do | |
Router.handle(:elli_request.method(r), :elli_request.path(r), r) | |
rescue | |
exception -> | |
Logger.error(inspect(exception)) |
id | |
|> get() | |
|> Maybe.and_then(& &1.size) |
# Given methods that return Results... | |
get_params | |
.and_then(method(:validate_params)) | |
.and_then(method(:save_record)) | |
.and_then(method(:send_email)) | |
.match(ok: method(:render_success), | |
error: method(:render_failure)) |
require 'result/ok' | |
require 'result/error' | |
# | |
# A generic representation of success and failure. | |
# | |
# Styled after the Result monad of Elm and Rust | |
# (or the Either monad of Haskell). | |
# | |
# The `#and_then` method can be used to chain functions that |
module Main where | |
import Prelude | |
import Control.Monad.Eff.Console | |
import Data.Foldable (foldl) | |
import Data.String as String | |
import Data.Char as Char | |
import Data.List as List | |
import Data.List (List(Nil), (:)) | |
import Data.Array as Array |
export function makeAnimal({ name, size }) { | |
const sayHello = () => `Hello, I'm ${name}`; | |
const isBigger = (other) => size > other.size; | |
return Object.freeze({ | |
sayHello, | |
isBigger, | |
size, | |
}); |
defmodule Pattern do | |
@pattern quote do: {:attr, payload} | |
defmacro pattern do | |
quote do: {:macro, payload} | |
end | |
def match(unquote(@pattern) = argument) do |