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
(ns railway-oriented-programming | |
"An adaptation of [Railway Oriented Programming](rop) using the | |
[Cats](cats) library in Clojure. | |
[rop]: http://fsharpforfunandprofit.com/posts/recipe-part2/ | |
[cats]: https://github.com/funcool/cats" | |
(:require [cats.builtin] | |
[cats.core :as cats] | |
[cats.monad.either :as either])) |
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
module Ellie.Ui.CodeEditor | |
exposing | |
( Attribute | |
, LinterMessage | |
, Position | |
, Severity(..) | |
, linterMessages | |
, mode | |
, onChange | |
, readOnly |
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
;; This is the Wikipedia entry example encoded graph. | |
(def graph {:orig [{:a 1.5 :d 2} 0] | |
:a [{:orig 1.5 :b 2} 4] | |
:b [{:a 2 :c 3} 2] | |
:c [{:b 3 :dest 4} 4] | |
:dest [{:c 4 :e 2} 0] | |
:e [{:dest 2 :d 3} 2] | |
:d [{:orig 2 :e 3} 4.5]}) | |
(defn a* [graph orig dest] |
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
(comment "This is a small experiment inspired by Oskar Wickströms | |
excellent work at | |
https://haskell-at-work.com/episodes/2018-01-19-domain-modelling-with-haskell-data-structures.html. | |
I wanted to see what would be involved in building the equivalent | |
functionality in reasonably ideomatic Clojure. It is also my first | |
from scratch use of Clojure spec, which was a very interesting and | |
productive experience. It is amazing how little work one has to do | |
to be able to generate example datastructures for testing. The | |
generated examples helped me find a subtle bug in the tree pretty | |
printer, that would have been hard to find without." "I would love |
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
Please read original blog post for reference: | |
http://blog.process-one.net/embedding-ejabberd-into-an-elixir-phoenix-web-application/ |