Skip to content

Instantly share code, notes, and snippets.

View beckyconning's full-sized avatar

Becky Conning beckyconning

View GitHub Profile
qErrorToUnfoldable
∷ ∀ f
. Unfoldable f
⇒ Backend.QError
→ f Backend.QError
qErrorToUnfoldable =
unfoldr
(case _ of
Backend.MultipleErrors [] →
Nothing
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))
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
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
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
load  List.List DeckId  WorkspaceDSL Unit
load cursor = do
  st ← H.get
  case st.stateMode of
    Loadingdo
      rootId ← H.lift P.loadWorkspace
      case rootId of
        Left err → do
          providers ←
var domtoimage = window.domtoimage;
exports.toSvgImpl = function (element) {
return function () {
console.log("toSvgImpl");
return domtoimage.toSvg(element);
};
};
exports.toBlobImpl = function (element) {
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.
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
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 =