CakeML/cakeml

Add word shifts to basis

開放

#274 建立於 2017年5月3日

 (3 則留言) (0 個反應) (1 位負責人)Standard ML (98 個分叉)auto 404
enhancementhelp wanted

倉庫指標

星標
 (1,169 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Currently, the basis library doesn't include any shift operations in the Word8 or Word64 modules, and the parser can't generate Opapps with a Shift operation. Thus, the user cannot write programs that shift words in the surface syntax.

Ideally, we'd like to add >> and << as 2 argument CakeML functions, but the Shift op is a unary op with the amount to shift built into the operator. We either need to make Shift a binary op, or we have to add a restricted form of shifting where >> is defined in the basis as a function of two arguments that does a case split on the 2nd to pick out which Shift to actually do.

貢獻者指南