<p dir="ltr">If you write the literal in a string, apply 'read' and specify the type, then it should work.</p>
<p dir="ltr">If you write it in a string literal, then it might be that you need to use defaulting to get it to evaluate to Crust.</p>
<p dir="ltr">If you write just a bare <...> in ghci then afaik that won't ever work, as there's a fixed set of literals ghc's parser accepts.</p>
<div class="gmail_quote">On Jan 27, 2016 9:44 PM, "martin" <<a href="mailto:martin.drautzburg@web.de">martin.drautzburg@web.de</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello all,<br>
<br>
I've written my own Read and Show instances for a type, which is essentially<br>
<br>
data Crust a = Open [a] | Closed [a]<br>
<br>
"Show" does something like<br>
<br>
*Main> Closed [1,2,3]<br>
<1,2,3><br>
*Main> Open [1,2,3]<br>
<1,2,3..><br>
<br>
And Read faithully parses each stings and turns it into a Crust again.<br>
<br>
Problem is: when I just type <1,2,3..> in GHCi I get a "parse error on input ‘<’". However when I spell out the<br>
custructor as above it parses it okay.<br>
<br>
Is it possible at all to write my own <> constructor, or something like it=<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
</blockquote></div>