Quantcast
Channel: Active questions tagged ocaml - Stack Overflow
Viewing all articles
Browse latest Browse all 527

How can I open List without importing the type List.t?

$
0
0

I'm using OCaml 5.3.0.

I like to write open List at the top of my source files, since I use list functions so frequently that I don't want to have to prefix them as e.g. List.length or even L.length. However, that pulls the declaration type 'a t = 'a list into my namespace. That has an annoying side effect: when VS Code displays a list type, it uses the t name so that I see e.g. int t rather than int list.

So is there some way I can open List without pulling in t? In Haskell I could write import List hiding (t), but I don't see an equivalent in OCaml.


Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>