Skip to content

Strange behavior with monadic bind #1697

@ranjitjhala

Description

@ranjitjhala

Via @nilehmann

https://gist.github.com/nilehmann/8ace3dd793dc78bf0af04f8ee3585b84

  • A.hs the code is safe using a monad where User is hardwired
  • B.hs the code is unsafe using a monad where user is a parameter
  • C.hs the code is safe where we use a plain bindT and returnT

Some mysterious goings on.

  1. Why is LH not failing on A.hs, B.hs demanding that --no-pattern-inline? Both use refined monads?
  2. Also, when run in the latest LH, A is safe with 1 checked constraint while C has 28 checked constraints?
  3. Why does C.hs need the assume statements but A and B do not? (are instance signatures "assumed" by default??)

@nikivazou -- I think you will need definitely need to take a look at this, it touches two things that I'm unfamiliar
with (the instances and bounds) but I'm guessing that won't happen until the after your deadline next week?

Metadata

Metadata

Assignees

Labels

absrefbugclassesPertaining to checking signatures for classes or instancesunsoundness

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions