Questions tagged [haskell]

For Haskell programming questions specifically related to Cardano. For more generic programming questions about Haskell, please consider using Stack Overflow instead.

Filter by
Sorted by
Tagged with
4
votes
3answers
91 views

Where is the best place to start looking for Haskell Developers?

I'm looking to hire developers for a project and most people I speak with have experience with Solidity and therefore trying to convince me to focus on the Ethereum ecosystem. I like what the Cardano ...
2
votes
1answer
27 views

Retrieve only digit from TokenName and use onchain

How can I make the following function to retrieve only digit portion from the TokenName and use it on chain? For example I want to retrieve the number 123 from "AAA123" (TokenName) {-# ...
1
vote
1answer
44 views

How to fix Duplicate instance declaration error in byron-spec-ledger package?

I'm trying to add cardano-wallet-core as a dependency to my Haskell project, so I can use the servant client. But I get this error when cabal builds the byron-spec-ledger package: [ 6 of 16] Compiling ...
3
votes
2answers
108 views

Developing on Cardano as a beginner

Is there a roadmap to learn Cardano Development as a beginner? I checked the Cardano Developer Portal but I could not find the following: What is the order in which one should learn things? For ...
2
votes
2answers
58 views

Insufficient funds when trying to use script unspent output

I was following the example from the basic split app and changing it a bit to try to make a simple sell/buy NFT transaction. For now I'm just trying to transfer the NFT from one wallet to another. My ...
0
votes
1answer
55 views

How to validate the correctness of another parameterized script address on-chain

I would like to write a factory script that can initialize another parameterized script address by sending it an NFT. The factory validator gets the parameters of the target script as redeemer and has ...
1
vote
0answers
22 views

Error When Running stack ghci on my MacOS Terminal

I am getting this error when I try to run stack ghci on my Mac Termina. How do I resolve this? I've run stack upgrade and stack update. Downloading lts-18.13 build plan ...RedownloadFailed Request { ...
1
vote
3answers
57 views

I have a cardano internal error

I ran the Cardano node command and it was fetching new tips for like a minuet then i get this error: cardano-node: internal error: Unable to commit 1048576 bytes of memory (GHC version 8.10.4 for ...
3
votes
1answer
38 views

What does it mean for a contract to "stop"?

I'm working through the week 4 homework for the Plutus Pioneer program. I've found an answer to the homework problem and now I'm trying to get a deeper understanding of the code. I've noticed that the ...
3
votes
2answers
86 views

Logging in validator

I'm working through the Plutus Pioneer program and I have a bug in my implementation of the validator for homework one. I'd like to add some logging to the validator to get more insight into what I'm ...
1
vote
1answer
100 views

Should I use Marlowe or Plutus to create my native token?

Should I use Marlowe or Plutus to create my token? I also want to create a TCG in which my token will have an utility. Where should i start? (tutorial, how-to, examples ...).
1
vote
1answer
11 views

HSL error for Datakinds extension in Week01 in VSCode

I'm trying to get type definitions for Plutus code in VSCode and I'm getting an unusual error. The first extension in the file is {-# LANGUAGE DataKinds #-} (<- this is a clickable link) and the ...
0
votes
1answer
16 views

Error when building HSL for GHC 8.10.4.20210212

I'm trying to get the haskell language server installed on my mac and I"m following the docs at https://docs.plutus-community.com/docs/setup/editors/prerequisites.html but they seem to not work. ...
0
votes
1answer
87 views

Haskell example programs

So I've been trying to learn Haskell for a week now but I think it's time to do some small projects (like, a small guessing game or such). Can you all direct me into some project's I can take a look ...
0
votes
0answers
21 views

Pioneer Lecture 6 - oracle client gets 403 error from coinmarketcap url

I'm running an ubuntu docker container on a MacOS host. I have the oracle-pab server running in a nix-shell, but when I try to run the oracle-client executable, I get this error: [nix-shell:/src/...
1
vote
0answers
39 views

Setting up .ghci for Haskell installation in WSL

I used the ghcup tool to install ghc and cabal, on completion I tried to create a .ghci file to print a new prompt. It gave me a warning *** WARNING: .ghci is writable by someone else, IGNORING! ...
3
votes
0answers
38 views

Launch.json for VSCode/Haskell? Learning Haskell Plutus

I have VSCode all set up with the necessary Haskell plugins (except I have GHCI 9.x installed via Chocolatey and the plugins want 8.x, ouch! Unfortunately Chocolatey won't accept an 8.x "--...
4
votes
1answer
82 views

Canonical example of Smart Contract Verification?

Given that the chief benefit of Cardano Smart Contracts over Ethereum Smart Contracts is formal verification (and thus its implied validity, security, and robustness), is there a non-trivial example ...
3
votes
1answer
51 views

Error with cabal build using plutus-starter-devcontainer on macOS Big Sur

I'm working to set up the plutus-starter-devcontainer integration with VSCode. Dev Environment: macOS Big Sur 11.5.2 Docker Desktop 4.0.0 Following the instructions from here: https://github.com/...
6
votes
1answer
93 views

haskell-language-server used in VSCode Haskell extension produces spurious INLINABLE compilation error message

When compiling supplied code for Plutus Pioneer Program, the haskell extension for VSCode IDE reports a compilation error. This prevents a lot of useful IDE functions from working, because the IDE ...
4
votes
1answer
43 views

Type instance syntax

I have already learned haskell from http://learnyouahaskell.com/chapters, but it doesn't cover the type instance syntax, like this: data Auctioning instance Scripts.ValidatorTypes Auctioning where ...
6
votes
1answer
108 views

The PAB is no longer working after upgrading the Plutus version

I upgraded the Plutus version used by my project to: 2f11c28bd8f6d630daab582255e16d8408075bd7 PS: It is the same version Lars used in his latest lecture (Iteration #2 - Lecture #8) Here is the code I'...
4
votes
1answer
93 views

How to get the funds available at a script using Plutus?

I am currently working on Lecture 8 in the Plutus Pioneer program. I want to view funds available at a script address. There appears to be a function that makes this easy in Ledger.AddressMap -- | Get ...
5
votes
2answers
139 views

Pioneer Lecture 4 recursion - how is it not infinite?

In the solution for the Lecture #4 (cohort 1 I guess, I'm following on Youtube) payContract :: Contract () PaySchema Text () payContract = do pp <- endpoint @"pay" let tx = ...
5
votes
1answer
53 views

Understanding do notation with Monads in Plutus Pioneer Week 04

I have a question regarding a block of code from th Week04 Plutus Pioneer Program. The block is in Writer.hs foo'' :: Writer Int -> Writer Int -> Writer Int -> Writer Int foo'' x y z = do ...
5
votes
2answers
94 views

How can I convert `Slot` to `TokenName`

I feel like this should be pretty easy, but I'm stumped. How can I use a slot number as a token name? I'm currently trying to encode the slot integer as a ByteString: slotNumberTokenName :: TokenName ...
6
votes
1answer
393 views

What does @ prefix means?

like this: auctionInstance = Scripts.validator @Auctioning and Hello-world app from https://playground.plutus.iohkdev.io/tutorial/tutorials/plutus-playground.html#running-the-hello-world-app hello = ...
7
votes
2answers
168 views

Is there documentation on the Prerequisites for Plutus Pioneer code?

I'm trying to run the Plutus Pioneer code on a Docker container based on https://hub.docker.com/r/nixos/nix. I've followed this guide to install Cabal and GHC https://www.reddit.com/r/haskell/comments/...
5
votes
1answer
142 views

What does two consecutive apostrophes mean in Haskell and Plutus?

I have noticed the frequent appearance of two consecutive apostrophes in Haskell code. Like this: newtype Date = Date Integer data EndDate = Fixed Integer | Never unstableMakeIsData ''Date ...
7
votes
1answer
134 views

How to stake a smart contract's money?

Is it possible to delegate the money locked in a smart contract? And how? Using what haskell instructions?
4
votes
2answers
140 views

do you need to know Haskell to code in marlowe

I'm interested to play with Marlowe in a textual way. when I read this tutorial or read some code examples here, it seems to me that I have to be knowledgeable about Haskell's basics, mainly variables ...
8
votes
3answers
214 views

How can I find the Haskell source code for the sqrt function?

I am starting to learn Haskell and need to learn how to look things up. Since I am studying a function that uses sqrt, I want to see how that was made in Haskell. This is as much an exercise in using ...
14
votes
1answer
296 views

How do I build a debug configuration of a Plutus project?

When I try to set a breakpoint in a small Plutus project such as this, I always get the following error: :b Week05.Homework1.mkPolicy cannot set breakpoint on Week05.Homework1.mkPolicy: module Week05....
13
votes
1answer
176 views

Haskell IDE INLINABLE error help

Have you encountered this error? IDE complains that the validator is not INLINABLE, while it actually is: Program error: GHC Core to PLC plugin: E043:Error: Reference to a name which is not a local, a ...