Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't work in ghci #32

Open
l29ah opened this issue Aug 31, 2020 · 1 comment
Open

doesn't work in ghci #32

l29ah opened this issue Aug 31, 2020 · 1 comment

Comments

@l29ah
Copy link

l29ah commented Aug 31, 2020

I've tried ghci with RecordDotPreprocessor (0.2.6) on GNU/Linux, but it doesn't seem to work at all (doesn't fail to load though):

‰ ghci -ignore-dot-ghci -fplugin=RecordDotPreprocessor -XOverloadedStrings -XFlexibleInstances -XIncoherentInstances -XMagicHash -XBangPatterns -XFlexibleContexts -XTypeApplications -XDeriveGeneric -XScopedTypeVariables -XDuplicateRecordFields -XDataKinds -XMultiParamTypeClasses -XTypeSynonymInstances
GHCi, version 8.10.1: https://www.haskell.org/ghc/  :? for help
Prelude> data A = A {a::Int}
Prelude> (A 666).a

<interactive>:2:2: error:
    • Couldn't match expected type ‘Int -> c’ with actual type ‘A’
    • Possible cause: ‘A’ is applied to too many arguments
      In the first argument of ‘(.)’, namely ‘(A 666)’
      In the expression: (A 666) . a
      In an equation for ‘it’: it = (A 666) . a
    • Relevant bindings include
        it :: A -> c (bound at <interactive>:2:1)
Prelude> :t (.a)
(.a) :: (Int -> c) -> A -> c
@ndmitchell
Copy link
Owner

Does it work with those definitions in a file? It may well be that plugins aren't applied in the ghci prompt, which wouldn't be too surprising (I've never checked either way, and on Windows, it doesn't work at all). To get that fixed would require GHC to adjust how plugins work - feel free to raise a GHC feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants