In Idris, how do I hide something defined in Prelude?

前端 未结 1 711

I want to define my own version of fib to play around with, but fib is exported by the Prelude. How do I hide the import from the

1条回答
  •  逝去的感伤
    2021-01-12 07:11

    As this Idris mailing post suggests:

    At the minute, all there is the (as yet undocumented) %hide directive, which makes a name inaccessible.

    Here is an example:

    %hide fib
    
    fib : Nat -> Nat
    fib Z = Z
    fib (S Z) = S Z
    fib (S (S n)) = fib n + fib (S n)
    

    0 讨论(0)
提交回复
热议问题