load ∷ List.List DeckId → WorkspaceDSL Unit
load cursor = do
st ← H.get
case st.stateMode of
Loading → do
rootId ← H.lift P.loadWorkspace
case rootId of
Left err → do
providers ←
This file contains hidden or 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
qErrorToUnfoldable | |
∷ ∀ f | |
. Unfoldable f | |
⇒ Backend.QError | |
→ f Backend.QError | |
qErrorToUnfoldable = | |
unfoldr | |
(case _ of | |
Backend.MultipleErrors [] → | |
Nothing |
This file contains hidden or 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
modifyFirstOrSnoc ∷ ∀ a. (a → a → Maybe a) → Array a → a → Array a | |
modifyFirstOrSnoc g xs x = | |
tailRec | |
(\{ acc, xs' } → | |
maybe | |
(Done (acc `Array.snoc` x)) | |
(\{ head, tail } → | |
maybe | |
(Loop { acc: acc `Array.snoc` head, xs': tail }) | |
(Done ∘ (append acc) ∘ (flip Array.cons tail)) |
This file contains hidden or 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
let P = {{1,2,3}, {2,3}, {2,4}} | |
m is a maximal element of P if ∀ s. s ∈ P ⇒ m ≤ s implies m = s | |
(P, ≤): | |
S¹ S² S³ | |
S¹ 1 0 0 🤷 ∀x(x ∈ {(S¹, S¹)} → fst x = snd x) = {(S¹, S¹)} ∴ S¹ is a maximal element of P |
This file contains hidden or 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
let P = {{1,2,3}, {2,3} {2,4}} | |
m is a maximal element of if ∀ s. s ∈ S ⇒ m ≤ s implies m = s | |
(P, ≤): | |
S¹ S² S³ | |
S¹ 1 0 0 🤷 ∀x(x ∈ {(S¹, S¹)} → fst x = snd x) = {(S¹, S¹)} ∴ S¹ is a maximal element of P |
This file contains hidden or 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
let P = {{1,2,3}, {2,3} {2,4}} | |
m is a maximal element of if ∀ s. s ∈ S ⇒ m ≤ s implies m = s | |
(P, ≤): | |
S¹ S² S³ | |
S¹ 1 0 0 🤷 ∀x(x ∈ {(S¹, S¹)} → fst x = snd x) = {(S¹, S¹)} ∴ S¹ is a maximal element of P |
This file contains hidden or 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
var domtoimage = window.domtoimage; | |
exports.toSvgImpl = function (element) { | |
return function () { | |
console.log("toSvgImpl"); | |
return domtoimage.toSvg(element); | |
}; | |
}; | |
exports.toBlobImpl = function (element) { |
This file contains hidden or 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 Codewars.Kata.Dubstep where | |
import Prelude | |
import Data.List (unwords) | |
import Text.Parsec (many1, manyTill, try, anyChar, string, parse, many, skipMany, (<|>)) | |
-- unwords . filter (not . null) . splitOn "WUB" | |
-- The above is clearly the stronger solution however parser combinators are cool. |
This file contains hidden or 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 Codewars.Kata.Dubstep where | |
import Prelude | |
import Data.Functor (($>)) | |
import Data.Functor.Identity (Identity) | |
import Data.List (unwords, filter) | |
import Data.List.Split (splitOn) | |
import Data.Text (strip, pack, unpack) | |
import Text.Parsec |
This file contains hidden or 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 Codewars.Kata.Dubstep where | |
import Prelude | |
import Control.Monad (join) | |
import Data.List | |
import Data.Text (strip, pack, unpack) | |
import Text.Parsec | |
songDecoder :: String -> String | |
songDecoder = |