Skip to content

Instantly share code, notes, and snippets.

View jsoo1's full-sized avatar

John Soo jsoo1

View GitHub Profile
@jsoo1
jsoo1 / Aoc2021Prob22.hs
Created March 29, 2022 04:29
aoc-2021-22
{-# LANGUAGE NamedFieldPuns #-}
module Aoc2021Prob22 where
import Data.Bifunctor (bimap)
import Data.Maybe (fromJust)
import Text.Read (readMaybe)
data SpecLine = SpecLine
{ state :: State
, cuboid :: Cuboid
@jsoo1
jsoo1 / learning-new-language-survey-applied-to-haskell.org
Last active March 27, 2022 00:18
Hillel Wayne's "The Hard Part of Learning a Language" answered by me for Haskell

Hillel Wayne’s - The Hard Part of Learning a Language as answered for Haskell by me

First of all, thank you for giving Haskell a try! Welcome to a lifelong pursuit of Learning Haskell.

Note that this is colored by my experience. I do not use Windows. I do not use {,neo}vim.

I want to answer this survey to prevent another Tech Thoughtleader from misrepresenting Haskell. Haskell is hard and different enough

@jsoo1
jsoo1 / ApplyingFunctions.hs
Last active March 8, 2022 05:34
applying functions to a value
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE DerivingStrategies #-}
module ApplyingFunctions where
import System.IO
import Data.Foldable
import Control.Applicative
import Control.Monad
@jsoo1
jsoo1 / Apply.idr
Last active December 3, 2020 14:39
Lisp apply in idris
module Apply2
||| Heterogenious lists.
|||
|||```idris example
|||
||| hl : Hlist [Nat, (Double, Char), 1 = 1]
||| hl = [1, (3.0, 'a'), Refl]
|||```
data Hlist : List Type -> Type where
@jsoo1
jsoo1 / Main.hs
Last active September 17, 2019 04:07
Orange Combinator Notes 2019-09-16
{-# LANGUAGE DeriveFunctor #-}
module Main where
import Prelude hiding (map)
main :: IO ()
main = undefined
-- f is the name of a definition
@jsoo1
jsoo1 / Combinator2.idr
Last active November 27, 2018 17:46
Some example code from the Orange Combinator Meetup
module Combinator2
%default total
data LTE : Ord a => a -> a -> Type where
XLTY : Ord a => (x : a) -> (y : a) -> { auto x_lt_y : LT = x `compare` y } -> x `LTE` y
XEQY : Ord a => (x : a) -> (y : a) -> { auto x_eq_y : EQ = x `compare` y } -> x `LTE` y
lteExample : Combinator2.LTE 0 1