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 let-not | |
^{:author "Mike Weaver" | |
:see-also [["https://github.com/clojure/algo.monads"] | |
["https://brehaut.net/blog/2011/error_monads_revisited" "Error monads revisited"]] | |
:doc "A monad for short-circuiting computation based on a `fail?` predicate."} | |
(:require [clojure.algo.monads :refer [monad domonad]])) | |
(defn break-m | |
"An extension to the `maybe-m` monad that in addition to checking for `nil?` | |
checks if the computation fails using predicate `fail?`." |
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 natural-compare | |
^{:author "Mike Weaver" | |
:see-also [["https://gist.github.com/wilkerlucio/db54dc83a9664124f3febf6356f04509" | |
"Alphabetical/Natural sorting in Clojure/Clojurescript"]] | |
:doc "A comparator for natural sorting."} | |
(:require [clojure.string :as str])) | |
(defn split-digits | |
"Splits string into sequence of alternating text and numbers." | |
[s] |