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 HelloReactHooks.Main where | |
import Prelude | |
import Data.Maybe (Maybe(..)) | |
import Effect (Effect) | |
import Effect.Exception (throw) | |
import React.Basic.DOM as R | |
import React.Basic.DOM.Client (createRoot, renderRoot) | |
import Web.DOM.NonElementParentNode (getElementById) |
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
{ config, pkgs, lib, ... }: | |
let | |
zsh-plugins = { | |
nix-shell = (fetchGit { | |
url = "https://github.com/chisui/zsh-nix-shell.git"; | |
rev = "69e90b9bccecd84734948fb03087c2454a8522f6"; | |
}); | |
nix-zsh-completions = (fetchGit { |
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
import * as L from "fp-ts-foldl" | |
import Immutable from "immutable" | |
import { readonlyArray as RA, readonlyNonEmptyArray as RNEA } from "fp-ts" | |
import { pipe } from "fp-ts/function" | |
import * as t from "transducers-js" | |
const inc = (n: number) => n + 1 | |
const isEven = (n: number) => n % 2 === 0 | |
const sum = (a: number, b: number) => a + b |
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 Main where | |
import Prelude | |
import Effect (Effect) | |
import Elmish.Dispatch (Dispatch) | |
import Control.Monad.Cont (Cont, runCont) | |
import Data.Newtype (class Newtype) | |
newtype Effect' a = Effect' (Cont (Effect Unit) a) |
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 Main where | |
import Prelude | |
import Effect.Console (log) | |
import TryPureScript | |
whenFalseAndTrue = when (false && true) do | |
log "whenFalseAndTrue" | |
whenTrue = when true do |
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 Main where | |
import Prelude | |
import Data.Foldable (traverse_) | |
import Effect.Console (log) | |
import TryPureScript (render, withConsole) | |
abc item = when (item.name == "NAME") $ do | |
log "Here" |
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 Main where | |
import Prelude | |
import Color (Color, black, toHexString, white, rgb) | |
import Control.Monad.Rec.Loops (iterateWhile) | |
import Control.Alternative (guard) | |
import Data.Array.NonEmpty (NonEmptyArray, cons, cons', dropEnd, head, singleton) | |
import Data.Int (toNumber) | |
import Data.Maybe (maybe) |
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
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs). | |
# So here's a minimal Gist which worked for me as an install on a new M1 Pro. | |
# Inspired by https://github.com/malob/nixpkgs I highly recommend looking at malob's repo for a more thorough configuration | |
# | |
# Let's get started | |
# | |
# Let's install nix (at the time of writing this is version 2.5.1 | |
curl -L https://nixos.org/nix/install | sh | |
# I might not have needed to, but I rebooted |
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 Main where | |
import Prelude | |
import Prim.Row (class Nub, class Union) | |
import React.Basic.DOM as DOM | |
import React.Basic.DOM.Generated (Props_video) | |
import React.Basic.Hooks (Component) | |
import React.Basic.Hooks as React | |
import Record (merge) |
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 Main where | |
import Prelude | |
import Data.Array as Array | |
import Data.FingerTree (FingerTree) | |
import Data.FingerTree as FingerTree | |
import Data.Lazy as Lazy | |
import Data.Monoid.Additive (Additive(..)) | |
import Data.Newtype (class Newtype) |