<div dir="ltr">There's also <a href="https://github.com/xmonad/xmonad-contrib/blob/master/XMonad/Prelude.hs#L135-L156">https://github.com/xmonad/xmonad-contrib/blob/master/XMonad/Prelude.hs#L135-L156</a> although it also does a few other things.</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, Jul 21, 2025 at 7:57 AM Tristan Cacqueray via Haskell-Cafe <<a href="mailto:haskell-cafe@haskell.org">haskell-cafe@haskell.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Hello, unfortunately there is no "expandHomePath" or "realpath" helpers<br>
in the standard libraries. Searching for "FilePath -> IO FilePath" in<br>
hoogle shows an implementation in the hledger project:<br>
  <a href="https://hackage-content.haskell.org/package/hledger-lib-1.43.2/docs/Hledger-Utils-IO.html#v:expandHomePath" rel="noreferrer" target="_blank">https://hackage-content.haskell.org/package/hledger-lib-1.43.2/docs/Hledger-Utils-IO.html#v:expandHomePath</a><br>
<br>
… which check if the path begins with "~/", and replace that with the<br>
output of "getHomeDirectory"<br>
<br>
-Tristan<br>
<br>
On Mon, Jul 21, 2025 at 07:19 PICCA Frederic-Emmanuel wrote:<br>
> Hello, I am trying to open and read the content of this kind of filepath.<br>
><br>
> ~/debian/changelog<br>
><br>
> So is there a prefered way to expand the ~ into the real $HOME.<br>
><br>
> thanks for your help<br>
><br>
> Frédéric<br>
><br>
><br>
> Classification de confidentialité SOLEIL<br>
><br>
> Ce message et ses pièces jointes peuvent contenir des informations soumises à des règles de diffusion :<br>
><br>
>   *   P (Public) : Diffusion libre y compris à l'extérieur de SOLEIL.<br>
>   *   I (Interne) : Diffusion libre au sein de SOLEIL, ne doit pas être communiqué à l’extérieur sauf mention spécifique.<br>
>   *   C (Confidentiel) : Diffusion restreinte aux personnes autorisées, internes ou externes. Le partage nécessite l'accord de la hiérarchie.<br>
>   *   S (Sensible) : Accès restreint aux seuls destinataires. Partage non autorisé.<br>
><br>
> Les informations contenues dans cet e-mail sont la propriété de SOLEIL. Si vous n'êtes pas le destinataire prévu, merci de nous en notifier et de ne pas utiliser, copier ou distribuer les informations qu'il contient.<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" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
> Only members subscribed via the mailman list are allowed to post.<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" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>brandon s allbery kf8nh</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a></div></div></div></div></div>