hpdeifel / hledger-iadd

A terminal UI as drop-in replacement for hledger add.
BSD 3-Clause "New" or "Revised" License
77 stars 8 forks source link

Couldn't match expected type 'BrickEvent n e0' #69

Open tgrosinger opened 2 years ago

tgrosinger commented 2 years ago

I am working on am arm64 build of hledger-iadd for my hledger-multiarch project. I'm so close to having it compile successfully. It failed at the very end with this error. Please let me know if you have any suggestions.

The command I ran was stack install --allow-different-user hledger-iadd.

brick                            > Registering library for brick-0.73..
hledger-iadd                     > configure
hledger-iadd                     > Configuring hledger-iadd-1.3.17...
hledger-iadd                     > build
hledger-iadd                     > Preprocessing library for hledger-iadd-1.3.17..
hledger-iadd                     > Building library for hledger-iadd-1.3.17..
hledger-iadd                     > [ 1 of 13] Compiling AmountParser
hledger-iadd                     > [ 2 of 13] Compiling Brick.Widgets.BetterDialog
hledger-iadd                     > [ 3 of 13] Compiling Brick.Widgets.Border.Utils
hledger-iadd                     > [ 4 of 13] Compiling Brick.Widgets.Edit.EmacsBindings
hledger-iadd                     >
hledger-iadd                     > /tmp/stack-c805d8744a93ec26/hledger-iadd-1.3.17/src/Brick/Widgets/Edit/EmacsBindings.hs:86:36: error:
hledger-iadd                     >     • Couldn't match expected type ‘BrickEvent n e0’
hledger-iadd                     >                   with actual type ‘Event’
hledger-iadd                     >     • In the first argument of ‘E.handleEditorEvent’, namely ‘event’
hledger-iadd                     >       In a stmt of a 'do' block:
hledger-iadd                     >         newOrig <- E.handleEditorEvent event (edit ^. origEditor)
hledger-iadd                     >       In the expression:
hledger-iadd                     >         do newOrig <- E.handleEditorEvent event (edit ^. origEditor)
hledger-iadd                     >            return $ edit & origEditor .~ newOrig
hledger-iadd                     >     • Relevant bindings include
hledger-iadd                     >         edit :: Editor n
hledger-iadd                     >           (bound at src/Brick/Widgets/Edit/EmacsBindings.hs:71:25)
hledger-iadd                     >         handleEditorEvent :: Event -> Editor n -> EventM n (Editor n)
hledger-iadd                     >           (bound at src/Brick/Widgets/Edit/EmacsBindings.hs:71:1)
hledger-iadd                     >    |
hledger-iadd                     > 86 |     newOrig <- E.handleEditorEvent event (edit^.origEditor)
hledger-iadd                     >    |                                    ^^^^^
tgrosinger commented 2 years ago

Relates to #43

tgrosinger commented 2 years ago

If I build with --resolver=lts it fails right at the beginning with a different error:

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
ghc: could not execute: opt

I've tried installing a few versions of llvm with no luck. I'm building from Ubuntu.

hpdeifel commented 2 years ago

The first error seems unrelated to the architecture, the second one could be related (although it's hard to judge from a distance).

Could you maybe try with ghcup and cabal?

tgrosinger commented 2 years ago

Unfortunately I am seeing the same LLVM errors when installing with cabal. I installed llvm-12 with apt and tried again, but got the same results.

pmcginn commented 2 years ago

I'm not trying to do exactly the same as you (I was just trying to run the hledger install script), but I got the same error when trying to compile hledger-iadd on my Raspberry Pi 400. I fixed it by:

hpdeifel commented 2 years ago

The error in the OP is #71, btw. I will fix that in due time, but it's definitely unrelated to the architecture