google-research / dex-lang

Research language for array processing in the Haskell/ML family
BSD 3-Clause "New" or "Revised" License
1.58k stars 107 forks source link

Add pop function for stack, and some tests. #1234

Closed duvenaud closed 1 year ago

duvenaud commented 1 year ago

I'm not sure whether @noinline is appropriate for this one. But adding it gives a compiler error related to the Data constraint, so I left it off for now.

I also think it might make sense to spin off all the stack functions into their own library file.

I'm halfway through a rewrite of sort to be a very type-safe demo of quicksort, but it's currently stalled, so in the meantime I thought I'd add this utility function.