Skip to content

Instantly share code, notes, and snippets.

View JordanMartinez's full-sized avatar

JordanMartinez

  • USA
View GitHub Profile
@JordanMartinez
JordanMartinez / Main.purs
Last active March 29, 2023 19:10
Generate mkFnX/runFnX FFI
module Main where
import Prelude
import Data.Array as Array
import Data.Foldable as F
import Data.Traversable as T
import Effect (Effect)
import Effect.Class.Console (log)
import TryPureScript as TryPureScript
@JordanMartinez
JordanMartinez / Main.purs
Created September 27, 2022 11:36
Supporting multiple implementations of type class instances for the same type
module Main where
import Prelude
import Control.Monad.Reader (ReaderT(..), runReader, runReaderT)
import Data.Identity (Identity(..))
import Data.Newtype (class Newtype, unwrap)
import Data.Symbol (class IsSymbol)
import Data.Tuple (Tuple(..))
import Effect (Effect)
@JordanMartinez
JordanMartinez / Main.purs
Created September 23, 2022 23:45
Delgate type class implementation to external one
module Foo where
import Prelude
import Control.Monad.Reader (ReaderT(..), runReader, runReaderT)
import Data.Array.NonEmpty (NonEmptyArray)
import Data.Identity (Identity)
import Data.Maybe (Maybe)
import Data.Symbol (class IsSymbol)
import Data.Tuple (Tuple(..))
@JordanMartinez
JordanMartinez / Main.purs
Created September 7, 2022 15:54
Folding over record of records - compiler bug?
module HeterogeneousLog.Main where
import Prelude
import Data.Symbol (class IsSymbol)
import Effect (Effect)
import Effect.Console (log)
import Heterogeneous.Folding (class FoldingWithIndex, class HFoldlWithIndex, hfoldlWithIndex)
import Prim.Row as Row
@JordanMartinez
JordanMartinez / Main.purs
Created August 20, 2022 15:09
Indexed Access Type - Dictionary Cost
module Main where
import Prelude
import Effect (Effect)
import Effect.Class.Console (log)
import TryPureScript as TryPureScript
import Prim.Row as Row
main :: Effect Unit
@JordanMartinez
JordanMartinez / Main.purs
Created August 8, 2022 17:06
Array.groupBy unexpected behavior
module Main where
import Prelude
import Data.Array as A
import Effect (Effect)
import Effect.Class.Console (log)
import TryPureScript as TryPureScript
import Debug (spy)
@JordanMartinez
JordanMartinez / hls-setup.sh
Last active August 8, 2022 13:36
HLS support for GHC 9.2.3
#!/usr/bin/env bash
ghcup install ghc 9.2.3
ghcup compile hls --git-ref master --overwrite-version 1.7.0.0-p1 --ghc 9.2.3 --cabal-update
@JordanMartinez
JordanMartinez / Main.purs
Created July 23, 2022 18:10
Array transpose implementation
module Main where
import Prelude
import Data.Array as A
import Data.Maybe (Maybe(..), maybe)
import Effect (Effect)
import Effect.Class.Console (log)
import TryPureScript as TryPureScript
@JordanMartinez
JordanMartinez / Main.purs
Created June 13, 2022 14:02
Skip Spaces Bug
module Main where
import Prelude
import Control.Alt ((<|>))
import Data.Array as Array
import Effect.Console (log)
import Effect (Effect)
import Parsing as P
import Parsing.Combinators as PC
@JordanMartinez
JordanMartinez / Main.purs
Last active June 3, 2022 23:35
Workaround to 3243
module Main where
import Prelude
import Effect (Effect)
import Effect.Console (log)
import Record.Unsafe (unsafeSet)
import Prim.Row (class Lacks)
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
import Prim.Row as Row