Questions tagged [yesod]

Yesod is a Haskell web framework for productive development of type-safe, RESTful, high performance web applications.

Yesod is a Haskell web framework for productive development of type-safe, RESTful, high performance web applications.

Yesod leverages Haskell's type system to turn runtime bugs into compule-time errors, for example to avoid XSS attacks or character encoding issues. Yesod contains several DSLs for templating ( for HTML, for Javascript, and or for CSS), to store data (Persistent), for routing, etc.

1334 questions
11
votes
2 answers

Send mail to an email address using Yesod

I'm unable to find any good documentation or examples of how to send an mail to an email address using Yesod. More practically, I'll extract the information the user typed inside a simple form (name, age, body of message) and send this information…
kolam
  • 731
  • 4
  • 17
11
votes
1 answer

Using persistent from within a Conduit

First up, a simplified version of the task I want to accomplish: I have several large files (amounting to 30GB) that I want to prune for duplicate entries. To this end, I establish a database of hashes of the data, and open the files one-by-one,…
Aleksandar Dimitrov
  • 9,275
  • 3
  • 41
  • 48
11
votes
2 answers

MongoDB Example for Yesod / Persistent

Haskell and Yesod newbie here. I've been trying to follow the Integration with Yesod example from the Persistent chapter in the Yesod book (http://www.yesodweb.com/book/persistent). The Sqlite compiles and runs fine it seems. However, I'm trying…
Victor
  • 584
  • 4
  • 16
10
votes
1 answer

What's the best way to write facebook apps in haskell?

I'm building a site in haskell and the yesod web framework as a side project, and what I'd like to do is create a facebook app that lets users search their wall and the wall of their friends and groups. I've considered using the JavaScript SDK, cbut…
Levi Campbell
  • 6,005
  • 7
  • 40
  • 47
10
votes
2 answers

What is the recommended way to deploy Yesod?

I am on a shared web server, and I have apache2 installed locally, so I can set it up any way I need. What is the most supported way to deploy a yesod application? I can set up my apache2 as a proxy to Warp. Would this be the best setup? Or should I…
akonsu
  • 28,824
  • 33
  • 119
  • 194
10
votes
1 answer

Displaying dynamically generated images in Yesod

I'm writing my first Yesod app. The application involves the user selecting to view a graph, dynamically generated based on data stored in a DB on the server. I know how to get the user request and create the image on the server's file system, but…
Uri Barenholz
  • 693
  • 3
  • 13
10
votes
2 answers

How to let default values come from the database?

Why does the user object still have Nothing for createdAt and updatedAt? Why are those fields not getting assigned by the database? share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase| User email String createdAt UTCTime…
Saurabh Nanda
  • 6,373
  • 5
  • 31
  • 60
10
votes
2 answers

Store existing data-type with Yesod's Persistent

All the tutorials and references that I could find about Persistent describe in great detail how Persistent can automatically create a new data-type, schema, migration, etc. out of a single definition in its DSL. However, I couldn't find an…
Lemming
  • 4,085
  • 3
  • 23
  • 36
10
votes
1 answer

How to fetch entity by `Int` when a `Key` is expected in the Haskell persistent library?

I use Persistent orm with scotty web framework. I want to get value from db by id. These id are coming to me from GET request There are "get" function that takes "Key Entity" variable and returns "Maybe Entity". I use following code to get value…
Daiver
  • 1,488
  • 3
  • 18
  • 47
10
votes
3 answers

Yesod: Using typesafe URLs in AJAX calls

In my Yesod project i have the following route: /api/hide/thread/#Text/#Int ApiHideThreadR GET I want to request it on the client side with javascript: function hideThreadCompletely(threadId, board) { …
arrowd
  • 33,231
  • 8
  • 79
  • 110
10
votes
1 answer

persistent: How do I get the I in ACID

Assume I'm doing the following steps in a transaction: read some data A from the database do some calculation based on it write some data B to the database Is it possible to make this transaction fail if A has changed in the mean time? In short:…
Tobias Brandt
  • 3,393
  • 18
  • 28
10
votes
4 answers

Yesod ExitFailure 1 when installing scaffolded app

I'm trying to install my first scaffolded Yesod app. When I run cabal-dev install && yesod --dev devel it fails with ExitFailure 1. I'm using sqlite for persistent. Application.hs:49:44: No instance for…
Joar Leth
  • 691
  • 9
  • 27
10
votes
1 answer

Websockets in Yesod?

I would like to create a website using Yesod and websockets (html5). Can I use websockets with Yesod webframework?
barroco
  • 3,018
  • 6
  • 28
  • 38
9
votes
2 answers

Correct way to do a "join" in persist with yesod

Consider the models: Player name Text nick Text email Text Maybe phone Text Maybe note Textarea Maybe minutes Int Maybe deriving Table name Text game Text pointsHour Int seats Int Maybe description…
geoff
  • 831
  • 1
  • 5
  • 19
9
votes
1 answer

Codifying presence/absence of authentication at type level

Context: I'm approaching Haskell from a standpoint of converting runtime errors to compile-time errors. My hypothesis is that this is possible if one can codify business logic within the program's types itself. I'm writing a Telegram bot, which…
Saurabh Nanda
  • 6,373
  • 5
  • 31
  • 60
1 2
3
88 89