<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap:break-word"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><div id="bloop_customfont" style="margin:0px">Hi Martin,</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">Ghci defaults the type of 'getHole t1' to 'Maybe ()'. You can see this happening if you enable warnings in ghci with ':set -Wall'. Providing the correct type signature gives you the answer you're expecting:</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">*Main> getHole t1 :: Maybe [Int]</div><div id="bloop_customfont" style="margin:0px">Just [1,2,3]</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">Cheers,</div><div id="bloop_customfont" style="margin:0px">Martijn</div></div> <br><p class="airmail_on">On 10 juli 2016 at 11:55:48, martin (<a href="mailto:martin.drautzburg@web.de">martin.drautzburg@web.de</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>Hello all,<br><br>I do not understand why this simple piece of code returns Nothing instead of [1,2,3]. Can anybody help?<br><br>{-# LANGUAGE BangPatterns,NoMonomorphismRestriction, DeriveDataTypeable #-}<br>import Data.Typeable<br>import Data.Data<br>import Data.Generics.Zipper<br><br>ex_list1 :: [Int]<br>ex_list1 = [1,2,3]<br><br>t1 = toZipper ex_list1<br><br>-- *Main> getHole t1<br>-- Nothing<br>_______________________________________________<br>Haskell-Cafe mailing list<br>To (un)subscribe, modify options or view archives go to:<br><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>Only members subscribed via the mailman list are allowed to post.</div></div></span></blockquote></body></html>