Skip to content

Instantly share code, notes, and snippets.

View simonmichael's full-sized avatar

Simon Michael simonmichael

View GitHub Profile
@simonmichael
simonmichael / 1-readme.md
Last active December 8, 2023 18:18
SM's Handy Haskell Keywords (2023-12-08)
@simonmichael
simonmichael / gist:106bcd36fbbfd5d05340218112d50865
Created December 6, 2023 18:13
fendor/vscode-haskell HLS
2023-12-06 18:11:25.7720000 [client] DEBUG Environment variables:
2023-12-06 18:11:25.7720000 [client] DEBUG PATH: /Users/simon/.wasmedge/bin:/Users/simon/.wasmtime/bin:/Users/simon/adm/bin:/Users/simon/src/hledger/tools:/Users/simon/bin:/Users/simon/.ghcup/bin:/Users/simon/src/hledger/tools:/Users/simon/src/hledger/bin:/Users/simon/src/hledger/bin/old:/Users/simon/.local/bin:/Users/simon/.cabal/bin:/opt/homebrew/Cellar/janet/1.29.1/bin:/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/grep/libexec/gnubin:/opt/homebrew/opt/m4/bin:/opt/homebrew/opt/texinfo/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/simon/.cargo/bin:/Users/simon/.deno/bin:/Users/simon/.go/bin:/Users/simon/.gem/ruby/2.6.0/bin:/Users/simon/clients/championwindows/bin:/Users/simon/clients/championwindows/systems
2023-12-06 18:11:25.7720000 [client] INFO Finding haskell-language-server
2023-12-06 18:11:25.7730000 [client] INFO Checking for ghcup installation
2023-12-06 18:11:25.7780000 [client] INFO
@simonmichael
simonmichael / gist:9d3efe3d025edf4ce0b1371ad38b1ca4
Created December 6, 2023 17:57
fendor/vscode-haskell startup
2023-12-06 17:55:40.8120000 [client] DEBUG Environment variables:
2023-12-06 17:55:40.8130000 [client] DEBUG PATH: /Users/simon/.wasmedge/bin:/Users/simon/.wasmtime/bin:/Users/simon/adm/bin:/Users/simon/src/hledger/tools:/Users/simon/bin:/Users/simon/.ghcup/bin:/Users/simon/src/hledger/tools:/Users/simon/src/hledger/bin:/Users/simon/src/hledger/bin/old:/Users/simon/.local/bin:/Users/simon/.cabal/bin:/opt/homebrew/Cellar/janet/1.29.1/bin:/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/grep/libexec/gnubin:/opt/homebrew/opt/m4/bin:/opt/homebrew/opt/texinfo/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/simon/.cargo/bin:/Users/simon/.deno/bin:/Users/simon/.go/bin:/Users/simon/.gem/ruby/2.6.0/bin:/Users/simon/clients/championwindows/bin:/Users/simon/clients/championwindows/systems
2023-12-06 17:55:40.8130000 [client] INFO Finding haskell-language-server
2023-12-06 17:55:40.8140000 [client] INFO Checking for ghcup installation
2023-12-06 17:55:40.8170000 [client] INFO
2023-12-06 09:50:21.9870000 [client] DEBUG Environment variables:
2023-12-06 09:50:21.9880000 [client] DEBUG PATH: /Users/simon/.wasmtime/bin:/Users/simon/adm/bin:/Users/simon/src/hledger/tools:/Users/simon/bin:/Users/simon/.ghcup/bin:/Users/simon/src/hledger/tools:/Users/simon/src/hledger/bin:/Users/simon/src/hledger/bin/old:/Users/simon/.local/bin:/Users/simon/.cabal/bin:/opt/homebrew/Cellar/janet/1.29.1/bin:/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/grep/libexec/gnubin:/opt/homebrew/opt/m4/bin:/opt/homebrew/opt/texinfo/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/sbin:/Users/simon/.wasmtime/bin:/Users/simon/adm/bin:/Users/simon/src/hledger/tools:/Users/simon/bin:/Users/simon/.ghcup/bin:/Users/simon/src/hledger/tools:/Users/simon/src/hledger/bin:/Users/simon/src/hledger/bin/old:/Users/simon/.local/bin:/Users/simon/.cabal/bin:/opt/homebrew/Cellar/janet/1.29.1/bin:/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/grep/libexec/gnubin:/opt/homebrew/opt/m4/bin:/opt/homebrew/opt/texinfo/bin:/opt
@simonmichael
simonmichael / gist:471e39866094157b615fa55980f08f98
Created December 6, 2023 09:40
HLS startup failure, max verbosity
[Info - 11:37:57 PM] Stopping the server
[Trace - 11:37:57 PM] Sending request 'shutdown - (1)'.
[Trace - 11:37:57 PM] Received response 'shutdown - (1)' in 1ms.
No result returned.
[Trace - 11:37:57 PM] Sending notification 'exit'.
No parameters provided.
2023-12-06 05:14:29.4950000 [client] INFO Finding haskell-language-server
2023-12-06 05:14:29.5010000 [client] INFO Checking for ghcup installation
2023-12-06 05:14:29.5110000 [client] INFO found ghcup at ghcup
2023-12-06 05:14:29.5120000 [client] INFO Executing 'ghcup --no-verbose list -t hls -c installed -r' in cwd '/'
2023-12-06 05:14:30.6280000 [client] INFO Checking for ghcup installation
2023-12-06 05:14:30.6300000 [client] INFO found ghcup at ghcup
2023-12-06 05:14:30.6300000 [client] INFO Executing 'ghcup --no-verbose list -t cabal -c installed -r' in cwd '/'
2023-12-06 05:14:30.7320000 [client] INFO Checking for ghcup installation
2023-12-06 05:14:30.7350000 [client] INFO found ghcup at ghcup
2023-12-06 05:14:30.7350000 [client] INFO Executing 'ghcup --no-verbose list -t stack -c installed -r' in cwd '/'
@simonmichael
simonmichael / a.txt
Created December 6, 2023 02:18
HLS startup failure
2023-12-06 02:18:11.1340000 [client] INFO Finding haskell-language-server
2023-12-06 02:18:11.1350000 [client] INFO Checking for ghcup installation
2023-12-06 02:18:11.1370000 [client] INFO probing for GHCup binary
2023-12-06 02:18:11.1380000 [client] INFO Executing '/Users/simon/.ghcup/bin/ghcup --no-verbose list -t hls -c installed -r' in cwd '/'
2023-12-06 02:18:11.2840000 [client] INFO Checking for ghcup installation
2023-12-06 02:18:11.2860000 [client] INFO probing for GHCup binary
2023-12-06 02:18:11.2870000 [client] INFO Executing '/Users/simon/.ghcup/bin/ghcup --no-verbose list -t cabal -c installed -r' in cwd '/'
2023-12-06 02:18:11.3560000 [client] INFO Checking for ghcup installation
2023-12-06 02:18:11.3570000 [client] INFO probing for GHCup binary
2023-12-06 02:18:11.3590000 [client] INFO Executing '/Users/simon/.ghcup/bin/ghcup --no-verbose list -t stack -c installed -r' in cwd '/'
@simonmichael
simonmichael / a.txt
Created September 1, 2023 06:47
find ~/.ghcup
This file has been truncated, but you can view the full file.
/Users/simon/.ghcup
/Users/simon/.ghcup/cache
/Users/simon/.ghcup/cache/ghcup-prereleases-0.0.7.yaml.etags
/Users/simon/.ghcup/cache/ghcup-prereleases-0.0.7.yaml
/Users/simon/.ghcup/cache/ghcup-0.0.7.yaml.etags
/Users/simon/.ghcup/cache/ghcup-0.0.7.yaml
/Users/simon/.ghcup/bin
/Users/simon/.ghcup/bin/ghci-9.6.2
/Users/simon/.ghcup/bin/haskell-language-server-9.4.7~2.2.0.0
/Users/simon/.ghcup/bin/haddock-9.4.7
@simonmichael
simonmichael / a.bash
Created July 8, 2023 17:56
options parsing in bash
declare -A FLAGS
declare -a ARGS
while [[ $# -gt 0 ]]; do
key="$1"
@simonmichael
simonmichael / part1.md
Last active December 24, 2022 19:47
haskell programming with chatgpt, parsec task, from galactic_starfish on Haskell chat, reformat of https://gitlab.com/-/snippets/2476602

Parser P.1

Human: write me an example parser using the applicative style and 3 different tokens using the latest version of parsec in haskell.


Assistant:

Sure! Here is an example parser using the applicative style and 3 different tokens using the latest version of Parsec in Haskell:

  Copy code
import Text.Parsec

-- Our three tokens are integers, floating point numbers, and strings data Token = IntToken Int | FloatToken Double