ASCII ruler generation The challenge is to generate an ASCII character count ruler in the following format:

+-------------------------------------------------------------------------+
||    |    |    |    |    |    |    |    |    |    |    |    |    |    |  |
|0         10        20        30        40        50        60        70 |
|                                                                         |
+-------------------------------------------------------------------------+


The length of the ruler should be scalable to any multiple of 10.

Rules:


Ruler must be horizontal.
Let's say, to keep things simpler, that the ruler must work until the 1000 mark, all numbers left-aligned, one space after the final number.
Asking for a ruler with zero length should print NaR
Negative numbers should print a reversed ruler (-90, -80, -70, ...) with right-aligned numbers, in the exact same format as the one above otherwise


And, just printing to console is fine

Ready, set, golf!
Not going to beat the dynamic languages today, but anyway...

Haskell, 341

import Data.List
main=interact$unlines.m.map read.words
m[l,r]|r&gt;l=ᴛ.("┌│││└":).(++["┬   ─","┐│││┘"]).ʀ.t.ʀ.t.takeWhile((&gt;4).length).ᴛ$[c"┬",c"│    ",[l,l+10..r]&gt;&gt;=h.show,c" ",c"─"]|True=["NaR"]
h s=p s$length s;p s@('-':_)l=r(6-l)ꜱ++s++r 4ꜱ;p s l=r 5ꜱ++s++r(5-l)ꜱ
ᴛ=transpose;ʀ=reverse;r=replicate;c=cycle
ꜱ=' ';t l@(c:o)|c!!2==ꜱ=t o|True=l


I took the liberty of exchanging the actual ASCII characters with better-looking unicode box drawing chars.

$ echo "-50 30" | runhaskell  def0.hs
┌┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┐
│  │    │    │    │    │    │    │    │    │    │    │    │    │    │    │    │    │  │
│-50       -40       -30       -20       -10         0         10        20        30 │
│                                                                                     │
└─────────────────────────────────────────────────────────────────────────────────────┘