-
Notifications
You must be signed in to change notification settings - Fork 151
Description
Some questions and observations:
- I've found that the (default) develop branch of liquidhaskell doesn't build with stack. It's got duplicate entries for
containersin the extra-deps. Is nobody using the stack config anymore? Are you developing it against bleeding edge Hackage unpinned? - Are we expected always to use the latest Liquid Haskell? I found that a few features documented in the docs just don't match, so I'm attempting to install from GitHub, hence the bullet point above.
- Is there any work going on to make the parser more user-friendly?
- Features like abstract refinements don't seem to be documented anywhere. There's a link to two papers ([abstract_refinement_types.pdf](https://ranjitjhala.github.io/static/abstract_refinement_types.pdf)) and [1507.00385v1.pdf](https://arxiv.org/pdf/1507.00385). The
<{\x y z -> bool}>syntax appears quite mysterious - there are only a few examples, and I appear to be able to write whatever I want as variable names and they don't do anything (on 0.9.8.2). Perhaps it was a bleeding edge feature, but e.g.\x _ _ _ _ _ _ -> trueis accepted, and\x y z -> x == xis accepted, but\x y -> x == ysaysxis not in scope. In other words it appears completely arbitrary as a user. Maybe I can achieve what I want, maybe I can't. Is there a proper doc somewhere on what's intended vs what's implemented? - Meta comment but not important: as LH is niche but also changes fairly often, GenAI is on 95% hallucination mode (it seems to think LH can't deal with unboxed types, but I tested it and it was fine with it).
- I had some code from 9 years ago where I tried out liquid haskell, and quite a lot of the code no longer parsed or didn't resolve for various reasons.
I suppose I'm having a moan too, as I've been reading through the tutorial again and expected that it would have matured, but it still feels as rough around the edges as a decade ago.
Some basic ergonomics like Foo x:Int vs Foo (x:Int) -- seem to mean different things (not sure whether that's intentional or accidental), and Foo x:(Set Int) is needed for types with params, but you can't write {x:Set Int} as a convenience. Writing Foo x () <{\(x) -> ...}> yields a parse error about () rather than (x), which indicates the parser is still using too many try calls and this shows in the errors.
Stepping back for a more high-level view: For industrial use, it feels like one would have to have a lot of time to go back and forth with the maintainers. That's not a criticism, I'm trying to gauge the reality of where maintenance is at. Is it just a few of you (@ranjitjhala, @facundominguez, etc.) working on it in free time?
I wish I had more time to dabble, because on paper LH is amazing. But the dev experience and learning experience is rough, which I'm sorry about. I'm not sure when I'll get another block of time in which I can dabble with it.
Reduced simple example of the above on master:
{-# OPTIONS_GHC -fplugin=LiquidHaskell #-}
module LH2 where
import Data.Set (Set)
import Data.Functor.Identity
{-@ newtype M i o a <p :: i -> o -> Bool> = M (Identity a) @-}
newtype M i o a = M (Identity a)
{-@ assume foo :: M (Set Int) (Set Int) () <{\x y -> x == y}> @-}
foo :: M (Set Int) (Set Int) ()
foo = M (pure ())/home/chris/Work/chrisdone/liquidhaskell/LH2.hs:11:19: error:
Illegal type specification for `LH2.foo`
LH2.foo :: (LH2.M (Data.Set.Internal.Set GHC.Types.Int) (Data.Set.Internal.Set GHC.Types.Int) {VV : () | x##3 == VV})
Sort Error in Refinement: {VV : Tuple0 | x##3 == VV}
Unbound symbol x##3 --- perhaps you meant: VV, papp3, head, tail ?
Just assume
|
11 | {-@ assume foo :: M (Set Int) (Set Int) () <{\x y -> x == y}> @-}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Failed, 151 modules reloaded.
stack.yaml file which appears to pass tests:
flags:
liquidhaskell:
devel: true
tests:
stack: true
extra-package-dbs: []
ghc-options:
hscolour: -w
liquidhaskell-boot: -j
liquidhaskell: -j
packages:
- liquid-fixpoint
- liquid-prelude
- liquid-vector
- liquid-parallel
- liquidhaskell-boot
- tests
- .
extra-deps:
- parallel-3.2.2.0@sha256:3df46ec247e12b5e406a0adb9577294431b24814b30df420551d176fd112a966,2038
resolver: nightly-2026-01-04
nix:
packages: [cacert, git, hostname, nix, stack, z3]
path: [nixpkgs=./nixpkgs.nix]