[web-devel] Embedding a persist key into a hamlet template

Michael Snoyman michael at snoyman.com
Fri May 20 05:31:17 CEST 2011


That's definitely a possible approach. What I've been using recently
is toSinglePiece. I say recently because, prior to persistent 0.5,
this wasn't much of an issue, since a persist key was just a number.
Now that it's actually a PersistValue internally it's a bit more
complicated.

Michael

On Fri, May 20, 2011 at 2:51 AM, Mark Bradley <barkmadley at gmail.com> wrote:
> So far I have gotten away with:
>  let Right k = fromPersistValue (fromPersistKey id)
>  -- then use k as a Text
>
> but I am pretty sure there is a better way that I have just overlooked.
>
> On Fri, May 20, 2011 at 9:13 AM, Patrick Palka <patrick at parcs.ath.cx> wrote:
>> What's the most idiomatic way of embedding a persist key into a hamlet
>> template? (By persist key I mean a value of type Key a)
>>
>> _______________________________________________
>> web-devel mailing list
>> web-devel at haskell.org
>> http://www.haskell.org/mailman/listinfo/web-devel
>>
>
>
>
> --
> -barkmadley
> sent from an internet enabled device
>
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel
>



More information about the web-devel mailing list