Giter Site home page Giter Site logo

Support for stack about frp-arduino HOT 4 OPEN

frp-arduino avatar frp-arduino commented on September 27, 2024
Support for stack

from frp-arduino.

Comments (4)

miladhub avatar miladhub commented on September 27, 2024

My intent is simply to use stack here. For the benefit of reproducibility, I've created a project here: https://github.com/miladhub/myarduino copy-pasting Blink.hs into Main.hs and using the resolver version that should match the ghc version that you tested the project with.

Command stack build yields:

/private/var/folders/2l/76dm15b56vq3vdd1g16886w00000gn/T/stack4252/frp-arduino-0.1.1.0/src/Arduino/Internal/CodeGen/C.hs:333:17: error:
    • No instance for (Control.Monad.Fail.MonadFail
                         Data.Functor.Identity.Identity)
        arising from a do statement
        with the failable pattern ‘(Value x cType _ _)’
    • In a stmt of a 'do' block: (Value x cType _ _) <- genLLI value
      In the expression:
        do (Value x cType _ _) <- genLLI value
           block ("if (" ++ x ++ ") {")
             $ do line (register ++ " |= (1 << " ++ bit ++ ");")
           block "} else {"
             $ do line (register ++ " &= ~(1 << " ++ bit ++ ");")
           line "}"
      In a case alternative:
          _ -> do (Value x cType _ _) <- genLLI value
                  block ("if (" ++ x ++ ") {")
                    $ do line (register ++ " |= (1 << " ++ bit ++ ");")
                  block "} else {"
                    $ do line (register ++ " &= ~(1 << " ++ bit ++ ");")
                  ....
    |
333 |                 (Value x cType _ _) <- genLLI value
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

What am I doing wrong?

from frp-arduino.

jmwright avatar jmwright commented on September 27, 2024

I wonder if this is related.

spell-music/csound-catalog#4

from frp-arduino.

miladhub avatar miladhub commented on September 27, 2024

Just for the record, this works:

stack init
stack build

so I don't know why using this project as a dependency doesn't work. Right now I'm using it as an additional project after copy-pasting it into my project:

mkdir frp-arduino
cp -r /path/to/frp-arduino fro-arduino

and modify make follows:

$ git diff
diff --git a/make b/make
index b74fec1..5a2d848 100755
--- a/make
+++ b/make
@@ -10,9 +10,10 @@ if [ "$#" -lt 1 ]; then
                exit 1
 fi
 
+FRPDIR=$(dirname "$0")
 SOURCE=$1
 TARGET=$2
-OUTPUT_DIR=build-output/$(basename "$SOURCE")
+OUTPUT_DIR=$FRPDIR/build-output/$(basename "$SOURCE")
 BASENAME=$(basename "$SOURCE")
 
 # We do not want the file extension at this time
@@ -35,7 +36,7 @@ then
     rm -rf $OUTPUT_DIR
 else
     mkdir -p $OUTPUT_DIR
-    ghc \
+    stack exec -- ghc \
         --make \
         -Werror \
         -fwarn-unused-imports \

(forgot) Of course you also need to add frp-arduino as a sub-package:

packages:
- .
- frp-arduino

from frp-arduino.

1000000000 avatar 1000000000 commented on September 27, 2024

I found it was possible to fix the MonadFail compile error by using an older version of GHC which I did by setting my stack resolver to lts-12.26. I suspect the fact that manually importing it as a package works is because the frp-arduino version here on Github (which is the one you are using) is newer than the one on Hackage and has had that particular compiler error (which caused by changes in newer versions of GHC) fixed.

from frp-arduino.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.