Closed joeyh closed 1 year ago
It is exported as a pattern synonym: https://hackage.haskell.org/package/unix-2.8.1.1/docs/System-Posix-User.html#v:UserEntry
I had wrapper function like this, which checked an environment variable like HOME and fell back to getting the value from the UserEntry:
foo :: String -> (UserEntry -> String) -> IO String
The pattern synonym prevents that from compiling.
You probably want https://hackage.haskell.org/package/unix-2.8.1.1/docs/System-Posix-User.html#v:homeDirectory
Yes, pattere Synonyms are not 100% like record data types. So if you matched with record syntax, it won't compile. If you match with positional arguments or just use the function above, it'll work.
Prior to unix-2.8.0.0, System.Posix.User exported UserEntry. It no longer does, and it's only available from System.Poxis.User.ByteString. Necessitating some ugly cpp to handle both versions in code that uses the type. I suspect this was an accident, and System.Posix.User should re-export UserEntry.