Comments (4)
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.
I wonder if this is related.
from frp-arduino.
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.
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)
- What is your interest in frp-arduino? HOT 5
- Problem: PWM missing from API HOT 5
- Problem: IC2 missing from API HOT 2
- Problem: Num TypeClass not finished HOT 1
- Problem: Folds only work for numbers
- Problem: Arduino makefile is overkill
- Question: Should DAG.Expression remain untyped? HOT 14
- Issue handling process HOT 4
- How much optimization can we get from gcc? HOT 1
- Problem: LCD can only output static text
- Question: Could we use linear types to avoid duplicate resource allocation HOT 5
- Question: Potentially add support for random sampling HOT 2
- Question: Reading inputs via interrupts HOT 1
- Question: Why is there no pin9? HOT 3
- Project status HOT 7
- How would one add new Arduino microcontrollers HOT 7
- API Documentation Missing HOT 15
- test Fails Because of Missing Files in dist HOT 3
- Not able to run make succesfully HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frp-arduino.