profile
viewpoint
Devin Lehmacher lehmacdj Cornell University lehmacdj.github.io/blog Devin is a student at Cornell University. He likes OCaml, perl, and shell languages.

lehmacdj/haskell-through-diagrams-book 3

The source for the book haskell-through-diagrams

lehmacdj/hanabi 2

An implementation of hanabi, with a goal of writing some basic strategies to play.

lehmacdj/haskell-through-diagrams 1

The code to go along with the book haskell-through-diagrams.

lehmacdj/.dotfiles 0

My unix/linux configuration files.

lehmacdj/2020-2-29-stack-bug 0

A repro for a bug wherein `stack path` doesn't output the correct paths.

lehmacdj/3Drendering 0

Java Project for 3D Rendering

lehmacdj/blog 0

My blog currently titled λx.x

lehmacdj/book 0

The Rust Programming Language

lehmacdj/book_writer 0

Writes books full of nonsense. Mostly an exercise in Haskell monads and randomness.

lehmacdj/c-bst 0

A binary search tree implemented in C

push eventlehmacdj/.dotfiles

Devin Lehmacher

commit sha 7950fc1e53aaf077665e5830d83adcab8e662d03

additional aliases for remote branch management

view details

push time in 13 days

push eventlehmacdj/haskell-experiments

Devin Lehmacher

commit sha f8505e3b71680ac9367e953a4f465ed580a082a2

add uncompressed nauty distribution

view details

Devin Lehmacher

commit sha c1160dd85b38467f0fc77a5b710912f001bbc01a

add gitignore

view details

push time in 24 days

push eventlehmacdj/.dotfiles

Devin Lehmacher

commit sha d34af2e71356132f62dda120464582c58e330586

add :q alias for convenience

view details

push time in 25 days

push eventlehmacdj/hanabi

Devin Lehmacher

commit sha 47c544b3e1e662c315a792455e4cea6f0ae0660d

refactor to have less explicit parameter passing

view details

Devin Lehmacher

commit sha 7f6c9a858427f3250beca36c75ff1cbbd9d136a9

implement subscribeToState

view details

push time in a month

push eventlehmacdj/hanabi

Devin Lehmacher

commit sha af28ba0f70e7d6bba6fbb7182e489c191027b654

implement endpoint for performing actions

view details

Devin Lehmacher

commit sha 2d088501725669498444c493b3ab0d2546f35cdc

implement boilerplate necessary for websockets

view details

push time in a month

push eventlehmacdj/hanabi

Devin Lehmacher

commit sha 90e7356cd45b75c377158de0aa67b00dc1873ad2

start to use Embed IO in controllers

view details

Devin Lehmacher

commit sha 1a8f47f27a1b4975a56a799483fdcec697677b1a

rename a thing

view details

Devin Lehmacher

commit sha aa65e21b70824d5eec9df2655b0e590c96037788

simplify an effect out of fullGameLoop

view details

Devin Lehmacher

commit sha 2647d34b9315dd0d0f462430ce095aa1e7b92caf

rename to PError

view details

Devin Lehmacher

commit sha d50cea7be020c5238425148b51eab891766d64c9

add runInputChan function

view details

Devin Lehmacher

commit sha 72c18b16c4ec4497761f1dbd2d02effc2cfa782d

add runErrorChan

view details

Devin Lehmacher

commit sha 45a15feb9d4fc18414106d9ebd965caf6f0bd538

start games in api version

view details

push time in a month

push eventlehmacdj/hanabi

Devin Lehmacher

commit sha 19f99922598d224a287af087bd2a0c2ae90873bb

Revert "add cabal file back" This reverts commit cda23ccdf42eeb3b2bcc6aa52a44a609b023bcb8.

view details

push time in a month

push eventlehmacdj/hanabi

Devin Lehmacher

commit sha cda23ccdf42eeb3b2bcc6aa52a44a609b023bcb8

add cabal file back

view details

push time in a month

push eventlehmacdj/haskell-experiments

Devin Lehmacher

commit sha 35312dba66e881fc8b5ee9e5d27b194f0ee29c5d

use char literal

view details

Devin Lehmacher

commit sha 6615fcb7e4ee545d42d0ea8632c8404096b4ec7c

add a script for generating battleship games

view details

push time in 2 months

issue commentcommercialhaskell/stack

Add command line option to stack script to open it in ghci instead of running it

There's no way to run this script in Windows without changing the source code.

I suppose by this you are referring to the shebang. I'm pretty sure that even on windows (don't have Windows easily accessible to test though) you can run this using stack script Hey.hs if this is in a file named "Hey.hs".

In my opinion replacing the existing functionality with runhs would be a minor regression because it would forbid using it as a script interpreter on Linux, and running such a script would always require invoking runhs.

Unless of course runhs also supports being called from a shebang, in which case I suppose it would be advantageous, but the loss of backwards compatibility with existing stack scripts seems like a minor nuissance as well.

lehmacdj

comment created time in 2 months

issue commentcommercialhaskell/stack

Add command line option to stack script to open it in ghci instead of running it

This looks cool, but I think it would make more sense to integrate with the existing stack script functionality. That way we don't need to have two different formats for headers for files.

lehmacdj

comment created time in 2 months

issue openedcommercialhaskell/stack

Add command line option to stack script to open it in ghci instead of running it

Make sure that you are using the latest release (currently stack-2.3.1). See the upgrade instructions to upgrade.

Please state as clearly as possible what feature you are recommending, with motivation for the reason such a feature should be added.

created time in 2 months

push eventlehmacdj/.dotfiles

Devin Lehmacher

commit sha eb49381bedbae2b6207cccc92267c9760a1134e9

change bind for selection ranges

view details

Devin Lehmacher

commit sha e066d7b8483a3846005f2155494230a61956d59b

add syntax highlighting plugins back

view details

Devin Lehmacher

commit sha 415f1193654fcf94a4151898dacdc86411627d29

add a handler for deleted buffers

view details

Devin Lehmacher

commit sha b2f9578c5c1a614b1be7dd96f63aaec71de92dcc

add a thing I want to support to haskell.vim

view details

Devin Lehmacher

commit sha c45a482a7b8e0e0ef0a58f60e7a5294d393c5c91

improve find-above

view details

push time in 2 months

push eventlehmacdj/haskell-experiments

Devin Lehmacher

commit sha 7a7579577a26af7b920b63bb77952ce80b751631

setup better structure for experiments repo

view details

Devin Lehmacher

commit sha 1d929258176ae7eac6a7f66f6944c8437c5c14de

add a comment on organization

view details

Devin Lehmacher

commit sha 18003886f4d2a586109d72ec545098987f5225df

add GenMinesweeper for genning minesweeper games for discord

view details

Devin Lehmacher

commit sha 9d5c85eb318991caeabce9a3e41ec7cc13d0c203

add a doc comment to GenMinesweeper

view details

push time in 2 months

push eventlehmacdj/hanabi

Devin Lehmacher

commit sha 75044e12ee4483b2af1bf64dae2065726a6fedf9

add some implementation notes

view details

Devin Lehmacher

commit sha e9f1312a9c66a1df3141a53a6286b4a5dad7218b

some changes

view details

push time in 2 months

issue closedpolysemy-research/polysemy

Since AtomicState can implement the full interface of State, why not have it be the default State?

It seems like atomic state is more general, therefore it would allow code to be interpreted in more useful ways.

My proposal is simple: reimplement State the same way that AtomicState is implemented. This means that we would have:

data State m a where
    AtomicState :: (s -> (s, a)) -> AtomicState s m a 
    AtomicGet :: AtomicState s m s

The implementation of the actions would be the same as the ones from Polysemy.AtomicState, essentially:

get = atomicGet
put = atomicPut
modify = atomicModify

etc.

We would then be able to provide the atomic interpretations for this module in addition to the existing ones for the State effect.

For backwards compatibility we can keep the Polysemy.AtomicState module around. We can also keep around the current State effect as NonAtomicState if performance implications would cause someone to prefer that module over one that is compatible with atomicity.

Advantages:

  • Code written with the State effect could be interpreted such that all of the actions are interpreted atomically.
  • Less verbose code using atomic state

Drawbacks:

  • Performance may be worse. I'm not knowledgeable enough about Haskell performs to make a good judgement here.
  • Code written for State might not expect code to be run expecting atomic behavior. This might result in subtle concurrency bugs if people expect code that is interpretable in an atomic way to be written with concurrency in mind. Note: that this would not cause the code to violate the promises of atomicity, but merely it would still require care to reinterpret code written using the State effect atomically.

Assumptions:

  • The performance of AtomicState and State are close enough that swapping out the current implementation of put with essentially atomicPut is small enough that this api change is possible.

TLDR: As I wrote this I pretty much decided that the second drawback is probably large enough that it makes this not worth doing. Having to use AtomicState instead of State to get atomic interpretations is probably good as syntactic salt as a means for having people be more careful when writing concurrent code. However I'm still interested in if you (people working on polysemy have considered this design and if so what you're reasons for not going with it are).

closed time in 2 months

lehmacdj

issue commentpolysemy-research/polysemy

Since AtomicState can implement the full interface of State, why not have it be the default State?

But admitting atomic interpretations is also more abstract as it admits more possible interpretations.

I agree that the syntactic salt argument is good enough though that it isn't worth it though.

Thanks for confirming what I realized myself!

lehmacdj

comment created time in 2 months

issue openedpolysemy-research/polysemy

Since AtomicState can implement the full interface of State, why not have it be the default State?

It seems like atomic state is more general, therefore it would allow code to be interpreted in more useful ways.

My proposal is simple: reimplement State the same way that AtomicState is implemented. This means that we would have:

data State m a where
    AtomicState :: (s -> (s, a)) -> AtomicState s m a 
    AtomicGet :: AtomicState s m s

The implementation of the actions would be the same as the ones from Polysemy.AtomicState, essentially:

get = atomicGet
put = atomicPut
modify = atomicModify

etc.

We would then be able to provide the atomic interpretations for this module in addition to the existing ones for the State effect.

For backwards compatibility we can keep the Polysemy.AtomicState module around. We can also keep around the current State effect as NonAtomicState if performance implications would cause someone to prefer that module over one that is compatible with atomicity.

Advantages:

  • Code written with the State effect could be interpreted such that all of the actions are interpreted atomically.
  • Less verbose code using atomic state

Drawbacks:

  • Performance may be worse. I'm not knowledgeable enough about Haskell performs to make a good judgement here.
  • Code written for State might not expect code to be run expecting atomic behavior. This might result in subtle concurrency bugs if people expect code that is interpretable in an atomic way to be written with concurrency in mind. Note: that this would not cause the code to violate the promises of atomicity, but merely it would still require care to reinterpret code written using the State effect atomically.

Assumptions:

  • The performance of AtomicState and State are close enough that swapping out the current implementation of put with essentially atomicPut is small enough that this api change is possible.

TLDR: As I wrote this I pretty much decided that the second drawback is probably large enough that it makes this not worth doing. Having to use AtomicState instead of State to get atomic interpretations is probably good as syntactic salt as a means for having people be more careful when writing concurrent code. However I'm still interested in if you (people working on polysemy have considered this design and if so what you're reasons for not going with it are).

created time in 2 months

push eventlehmacdj/.dotfiles

Devin Lehmacher

commit sha 55cf6b90ebd57d14aa8b195e6456e0e7049cfd8d

add a conflicts command that shows conflicts

view details

Devin Lehmacher

commit sha 17d0297f13bf9c2942e22a330289bc6dbe303879

bug fixes to some aliases

view details

push time in 2 months

push eventlehmacdj/hanabi

Devin Lehmacher

commit sha c4e0b3c5dd1808c2573d852d4698c01a540e5b54

finish wiring some stuff together

view details

push time in 2 months

push eventlehmacdj/hanabi

Devin Lehmacher

commit sha db134bec58a433dafee1073a225103af93f2dea1

break out step game

view details

Devin Lehmacher

commit sha 38f5040a29e16c89257e94965552819a0372779f

prevent 1 player games

view details

Devin Lehmacher

commit sha c413dd7910d9c642db8b27fb236aed693996c366

implement several hanabi api endpoints

view details

push time in 2 months

push eventlehmacdj/hanabi

Devin Lehmacher

commit sha db9f9d872f0871baad88e082e1d02d6916da3686

add GameState map to types

view details

push time in 2 months

push eventlehmacdj/hanabi

Devin Lehmacher

commit sha 458e91b4eb3752255df19fb45def846379091b20

implement a method for generating a guest player

view details

Devin Lehmacher

commit sha 8c9731c587bb5521da3a9ec5a51653bdeea93dfd

add explicit exports to Player.hs

view details

Devin Lehmacher

commit sha 82967370f902c1487552848dfe3e3b95f05cd8de

add random package

view details

Devin Lehmacher

commit sha af5bc15bf6ee23da735900427166de977fbb8694

implement a little bit of API skeleton

view details

Devin Lehmacher

commit sha d33a55a1f8dbc36c48d02c741899ce4d40c7b20b

hide Handler export from MyPrelude

view details

Devin Lehmacher

commit sha 7d1d22547422f9c9fcd1b2cf13f445f8525b4a58

add createGuestUser function

view details

Devin Lehmacher

commit sha da65e23797e51a7c32c583b98fe12a64d300014f

implement some of the interface for hanabiApi

view details

Devin Lehmacher

commit sha 5951eb8ff7f152df52633be807c8c683f2cf9901

add a comment about trouble with createGuestUser

view details

push time in 2 months

push eventlehmacdj/.dotfiles

Devin Lehmacher

commit sha 8da197c85f3eb0cb7d319721ed46c2425937be06

retab file to fix mixed indent

view details

push time in 2 months

push eventlehmacdj/.dotfiles

Devin Lehmacher

commit sha 1ea9b615ceff2cf9e981ac792735569b8b0cccc4

add some aliases

view details

push time in 2 months

push eventlehmacdj/hanabi

Devin Lehmacher

commit sha 1eab3a1795e7338fda7ce2cc4557c9627313ba00

update ci file to ignore builds other than stack

view details

Devin Lehmacher

commit sha 1b8170d0cf5b057d3bcf9c6f255d1665102aa9b7

add conduit dependency

view details

Devin Lehmacher

commit sha ba9d4e68da550a53a4b7e644933840b638588fbc

fix bug in api + add some plumbing

view details

Devin Lehmacher

commit sha 42dd46601b694ec4e3ee6a3da05440e5d029ed5e

add a comment about migrating to AsServerT

view details

push time in 3 months

push eventlehmacdj/hanabi

Devin Lehmacher

commit sha e87de71d812b34a4cbae50a811e4d32e41b1f1ab

add ci file

view details

push time in 3 months

push eventlehmacdj/hanabi

Devin Lehmacher

commit sha 0a539e7ca8889adaddfa9b3b9d63e18c34c147a3

flesh out api a little bit

view details

Devin Lehmacher

commit sha b8aaa980f0f1afb32426e4f12111073c8cd226b6

remove useless comment

view details

Devin Lehmacher

commit sha b2b2efa7b042057ba0bb7e1f1ac02ac373982b15

remove useless comment

view details

Devin Lehmacher

commit sha b95d5f553ee40e9fab3137f6c673b014969aec77

add a commented out endpoint for full gamestate

view details

Devin Lehmacher

commit sha d70cf85b3f6a341338c45471df370bda4f7ccf77

add game to route for game api

view details

Devin Lehmacher

commit sha 7763365f37bb82474a6b502604697b46786c229d

remove three player as nothing depends on it any more

view details

Devin Lehmacher

commit sha d0307e66074f5ff2e31f0ab31f44523d463caacd

add ci file

view details

push time in 3 months

push eventlehmacdj/hanabi

Devin Lehmacher

commit sha ffa31dfa247e91f339c9ea7e470b11201aa115d7

add servant-websockets dependency

view details

Devin Lehmacher

commit sha c9872f22d5cd018925fc6858e9911e583263f2d4

change type variables to concrete types for player

view details

push time in 3 months

push eventlehmacdj/.dotfiles

Devin Lehmacher

commit sha b1f1bfb6901135a509620ec65e4bcb5e0b56e0dc

add default git config

view details

push time in 3 months

push eventlehmacdj/.dotfiles

Devin Lehmacher

commit sha 3dc3342ae7eb81d088c39acc851068cfd71e6c3b

disable intero

view details

Devin Lehmacher

commit sha 548f3bcfb449cdd5430182831636117551495e68

invert + change documentation order

view details

Devin Lehmacher

commit sha 42ee56fe330e60ed1030ad5a951cfc02dc5af2aa

update coc-config

view details

Devin Lehmacher

commit sha 9375a8d4dfa277176f369a2fc0e32560aded05b6

allow some coc-list extensions

view details

Devin Lehmacher

commit sha b80c2788dffedca5f32b881b44af4293b9cfa8db

remove excess lines

view details

Devin Lehmacher

commit sha 4289791f59e1f44cef1be7f6f03e4991c3b52110

get rid of indentation options because they don't matter since I'm using ormolu

view details

Devin Lehmacher

commit sha b10b5f3758824af7a1c70e7168841e381c3ffb71

fix help command

view details

Devin Lehmacher

commit sha 3534381eb138050fc24c48e1f1199bda72ad34eb

add preliminary support for a ghci terminal

view details

push time in 3 months

push eventlehmacdj/.dotfiles

Devin Lehmacher

commit sha 7065def200fb230173a0bf6cf7a193a635fc0181

add ormolu to vim

view details

Devin Lehmacher

commit sha 0ec1a6c9b4a2760f76769544825dce1c204f54ed

add coc-config.vim

view details

Devin Lehmacher

commit sha a8747462b0392c4b1a149a97a6b14ec9f23b9ff4

Merge branch 'master' of github.com:lehmacdj/.dotfiles

view details

push time in 3 months

push eventlehmacdj/.dotfiles

Devin Lehmacher

commit sha 9b890ec71f8c5dd9f45f05b494cd88608541dfe4

add windows-path

view details

Devin Lehmacher

commit sha b6794cbbe64d0fa55b3953c781283804f9d23bed

fix a couple of commands

view details

push time in 3 months

push eventlehmacdj/.dotfiles

Devin Lehmacher

commit sha 99613e3f608b01fabc9eb79db51534e39ffe19f8

add a comment describing swap

view details

Devin Lehmacher

commit sha 4f4eddd8e7d6ae91f4aa4c823bc6bdc51c48a4b1

add error message for swap

view details

Devin Lehmacher

commit sha 60313f1fa03904f5959d27f2513c0baccde7cd0e

add find-above

view details

Devin Lehmacher

commit sha 8a3e111f2f7681311146053fedad9fc9fd46eab7

Merge branch 'master' of github.com:lehmacdj/.dotfiles

view details

push time in 3 months

push eventlehmacdj/hanabi

Devin Lehmacher

commit sha 53608c9235a09a0d56facea0bb756cd66bb26380

change type variables to concrete types for player

view details

Devin Lehmacher

commit sha ca59808b3681848a6f451c7bfdf8dcd76c9bb0d4

add servant-websockets dependency

view details

Devin Lehmacher

commit sha 5db2f908ffe5c47715d6e195ecb90f1cb5f1d06e

sort dependencies/default extensions

view details

Devin Lehmacher

commit sha 37ec093c64f9f42b4e265c9aca2946eecaa83657

update stack.yaml so it compiles

view details

push time in 3 months

more