Questions related to the Haskell web framework IHP (integrated Haskell Platform). https://ihp.digitallyinduced.com/
Questions tagged [ihp]
81 questions
2
votes
1 answer
IHP: can't load framework: Cocoa (not found)
I created a new IHP project and when I run it for the first time it gives me this error: can't load framework: Cocoa (not found). Is it something I missed? This error doesn't seem to appear on the troubleshooting page. (Running on macOS 11 Big Sur…

Toma
- 2,764
- 4
- 25
- 44
2
votes
1 answer
Following IHP guide seeing: Web/Controller: getDirectoryContents:openDirStream: does not exist
This is all that I see on the loaded page at localhost:8001 after running ./start after following the Hello World instructions on https://ihp.digitallyinduced.com/Guide/installation.html:
Web/Controller: getDirectoryContents:openDirStream: does not…

JimmyM
- 360
- 3
- 20
2
votes
1 answer
ihp/nix how to add wreq to dependencies without compile failing?
In an IHP project, I tried adding wreq to default.nix as described in https://ihp.digitallyinduced.com/Guide/recipes.html#making-a-http-request but I get
src/Codec/Crypto/RSA/Pure.hs:115:25: error:
• Could not deduce (MonadFail m) arising from a…

unhammer
- 4,306
- 2
- 39
- 52
1
vote
1 answer
Unable to install dependencies in IHP blog demo project
I'm new to IHP so I'm following the getting started guide.
I'm now stuck in the last part of Section 5 (extending with markdown).
When explaining how to install the required package, this are the instructions:
Adding a Markdown Library
To deal with…

gchicote
- 31
- 3
1
vote
1 answer
How do I pass values to a `sqlQuery "…WHERE x IN ?"` in IHP?
I've tried
users :: [Users] <- sqlQuery "SELECT * FROM users u … WHERE u.id IN ?" (userIds :: [Id User])
and (Only userIds) and (In userIds) but no success. I can't find any examples in the docs.

unhammer
- 4,306
- 2
- 39
- 52
1
vote
0 answers
How to write Advanced Policies for IHP DataSync?
I have the following schema:
Users: id, name
Group: id, room_id
Rooms: id
ChatMessages: id, body, user_id, room_id, created_at
The Guide shows how to create a basic policy for user_id column with ihp_user_info() function. However, here I want to…

Varun Rajput
- 235
- 1
- 7
1
vote
2 answers
Fields of `NewView' not initialised
I'm trying to go through the ihp blog tutorial, but I'm not sure how to resolve this error. I'm new to haskell. I've tried asking chat gpt, but no luck so far.
Do I need to initialize an empty comment when I create a post? I assume so because…

Geoff Langenderfer
- 746
- 1
- 9
- 21
1
vote
1 answer
How to set HTTP status code manually in IHP response
Context
I am using EasyCron (https://www.easycron.com) to ping an endpoint in my IHP app.
If the code on my app's side fails for some reason, I would like to set the HTTP status code to 503 or similar and display the errors in the response so…

stephenbenedict
- 95
- 7
1
vote
1 answer
how do I turn off ihp telemetry
how do I turn off ihp telemetry? A bad setting for a work laptop. I think it should be default off.
I tried adding this variable to .envrc without any luck:
~/work/1031exchange.ai/blog
❯ cat .envrc
PATH_add…

Geoff Langenderfer
- 746
- 1
- 9
- 21
1
vote
1 answer
Aeson parse IHP payload to record type
What I am trying to do?
I am receing a JSON payload in IHP and would like to convert to record type.
What I have
Record type that I've generated with the IHP generators
data Resource' userId providerId bookings = Resource
{ id :: (Id'…

hrust
- 734
- 1
- 11
- 34
1
vote
1 answer
How do you use
Is there some builtin method for HTML text field completion with a simple

unhammer
- 4,306
- 2
- 39
- 52
1
vote
0 answers
The custom layout isn't loading automatically
I have created a custom layout in Layout.hs. This is applied to a reporting page that has a different styling (CSS) and JS from the rest of the application.
The report page is accessed via link in the application.
The problem is that when landing on…

patro
- 11
- 2
1
vote
1 answer
IHP - Unable to retrieve special characters from request body
I'm trying to send the request using ajax:
const formBody = document.getElementById('body'); // my form data
const XHR = new XMLHttpRequest();
const params = "body=" + formBody;
XHR.open("POST", window.origin +…

Varun Rajput
- 235
- 1
- 7
1
vote
1 answer
Localizing an IHP application
Some features of the Haskell web framework IHP produce strings that are sen by the user, e.g. the error messages from validators like nonEmpty, and they are all in English.
How would I use IHP to produce a page with a non-English audience? Or, even…

Joachim Breitner
- 25,395
- 6
- 78
- 139
1
vote
1 answer
IHP - How to connect IHP's Postgres instance with Moodle?
I'm trying to connect IHP's Postgres instance with Moodle. The IHP Guide uses postgresql:///app?host=YOUR_PROJECT_DIRECTORY/build/db with the development server running to connect however Moodle further requires Database host, name, user, password,…

Varun Rajput
- 235
- 1
- 7