[Question]
  [
# Challenge:
Write a function or program that accepts a list of boolean values and returns all of the ranges of True's.
# Test Cases:
```
f [F]                               = []
f [T]                               = [[0,0]]
f [T,T,F,T]                         = [[0,1],[3,3]]
f [F,T,T,F,F,T,T,T]                 = [[1,2],[5,7]]
f [F,T,T,F,F,F,T,T,T,T]             = [[1,2],[6,9]]
f [T,T,F,F,F,T,T,T,T,T,T,T,T,T,T,F] = [[0,1],[5,14]]
f [F,F,T,T,F,F,F,F,F,F,F,F,T,T,T,T,T,T,T,T,F,F,F,F,F,F,F,F,F,F,F,F,F,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,T,T] = [[2,3],[12,19],[33,54],[93,94]]
```
# Rules:
* You may choose how input is encoded, e.g. a list, array, string, etc.
* The output must be encoded as a list-like of list-likes or a string showing such, so arrays, lists, tuples, matrices, vectors, etc.
* The boolean values must be encoded as constants, but otherwise any simple conversion of T/F to desired constants is allowed
* EDIT: *eval* or similar during runtime IS allowed.
* Don't to forget to explain how input is passed to the program/function and give its input/output for the test cases
* Conversion to desired input format not counted
* [Standard loopholes are disallowed](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default)
* If your language has a function to do this, it's not allowed
* I will not accept my own submission
* EDIT: Output format is flexible. If not printing a list or similar, range values must be separated by one non-numeric character and separate ranges as well.
# Scoring:
* Score is in bytes, unless unfit to your language (such as codels in Piet)
* Lowest score wins
There's a good bit of flexibility in input and output, but solutions where T/F are replaced with functions that do all the work are disallowed.
# Debugging:
If you write yours in Haskell or can call it from Haskell, the following will check your function/program:
```
import Test.QuickCheck
tf = cycle [True,False]
gen l = foldl (++) [] $ map (\i -> [tf!!i | x<-[1..i]]) l
putIn (a,b) l = zipWith (||) l [(a <= p) && (p <= b) | p <- [0..length l]]
putAllIn rs len = foldr putIn [False|i<-[1..len]] rs
main = print $ quickCheck (check functionNameGoesHere)
```
  
[Answer]
# Pyth, 18 bytes
```
CxR.:++~Zkz02_B_`T
```
[Test suite](https://pyth.herokuapp.com/?code=CxR.%3A%2B%2B~Zkz02_B_%60T&input=%0A0%0A1%0A1101%0A01100111%0A0110001111%0A1100011111111110%0A00110000000011111111000000000000011111111111111111111110000000000000000000000000000000000000011&test_suite=1&test_suite_input=0%0A1%0A1101%0A01100111%0A0110001111%0A1100011111111110%0A00110000000011111111000000000000011111111111111111111110000000000000000000000000000000000000011&debug=0)
True is represented as `1`, False as `0`.
Ranges are represented inclusively.
[Answer]
# Pyth, 17 16 bytes
```
fT.b*Y,~+ZNtZrQ8
```
Uses some fancy post-assign counter magic together with run length encoding.
Takes input as an array of `0`s and `1`s, e.g. `[1, 1, 0, 1, 0]`. Outputs like in the challenge, e.g. `[[0, 1], [3, 3]]`.
[Test Suite](https://pyth.herokuapp.com/?code=fT.b%2aY%2C~%2BZNtZrQ8&input=%5B0%5D%0A%5B1%5D%0A%5B1%2C1%2C0%2C0%2C0%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C0%5D&test_suite=1&test_suite_input=%5B0%5D%0A%5B1%5D%0A%5B1%2C1%2C0%2C1%5D%0A%5B0%2C1%2C1%2C0%2C0%2C1%2C1%2C1%5D%0A%5B0%2C1%2C1%2C0%2C0%2C0%2C1%2C1%2C1%2C1%5D%0A%5B1%2C1%2C0%2C0%2C0%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C0%5D%0A%5B0%2C0%2C1%2C1%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C1%2C1%5D&debug=0)
[Answer]
## [Retina](https://github.com/mbuettner/retina/issues), ~~82~~ ~~34~~ 27 bytes
```
\b(?<=(.)*_?)
$#1
_+
S_`:
```
The empty line should contain a single space.
Input is a flat string of `_` for true and `:` for false. Output is space-separated pairs, each on a separate line.
[Try it online.](http://retina.tryitonline.net/#code=XGIoPzw9KC4pKl8_KQokIzEKXysKIApTX2A6&input=Xzo6X186Ojo6Ojo6Ol9fX19fX19fOjo6Ojo6Ojo6Ojo6Ol9fX19fX19fX19fX19fX19fX19fX186Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ol9f)
### Explanation
The heavy golfing from 82 down to 27 bytes was possible by clever choice of the representation of true and false. I've picked a word character, `_`, (that isn't a digit) for true and a non-word character, `:`, (that doesn't need escaping) for false. That allows me to detect the ends of ranges as word boundaries. 
```
\b(?<=(.)*_?)
$#1
```
We match a word boundary. We want to replace that boundary with the corresponding index of the truthy value. In principle that is quite easy with Retina's recent `$#` feature, which counts the number of captures of a group. We simply capture each character in front of that position into a group. By counting those characters we get the position. The only catch is that the ends of the range are off by one now. We actually want the index of the character *in front* the match. That is also easily fixed by optionally matching a `_` which isn't captured, thereby skipping one character when we're at the end of a range.
```
_+
<space>
```
Now we replace all runs of underscores with a space. That is, we insert a space between the beginning and end of each range, while getting rid of the underscores.
```
S_`:
```
That leaves the colons (and we still need to separate pairs). We do that by splitting the entire string into lines around each colon. The `S` actives split mode, and the `_` suppresses empty segments such that don't get tons of empty lines when we have runs of colons.
[Answer]
## Python 2, 69 bytes
```
p=i=0
for x in input()+[0]:
 if x-p:b=x<p;print`i-b`+';'*b,
 p=x;i+=1
```
Example output:
```
2 3; 7 16; 18 18;
```
A direct approach, no built-ins. Tracks the current value `x` and the previous value `p`. When these are different, we've switched runs. On switching `0` to `1`, prints the current index `i`. On switching `1` to `0`, prints the current index minus one followed by a semicolon.
The `if` is pretty smelly. Maybe recursion would be better,
[Answer]
# [MATL](https://esolangs.org/wiki/MATL), 17 ~~18~~ ~~20~~ bytes
```
j'T+'1X32X34$2#XX
```
Uses [current version (9.1.0)](https://github.com/lmendo/MATL/releases/tag/9.1.0) of the language/compiler.
Input is a string containing characters `T` and `F`. Output is a two-row table, where each column indicates a range using 1-indexing, which is the language default.
Thanks to [Stewie Griffin](https://codegolf.stackexchange.com/users/31516/stewie-griffin) for removing 2 bytes.
### Example
```
>> matl
 > j'T+'1X32X34$2#XX
 >
> FTTFFFTTTT
2 7
3 10
```
### Explanation
It's based on a simple regular expression:
```
j         % input string
'T+'      % regular expression: match one or more `T` in a row
1X3       % predefined string literal: 'start'
2X3       % predefined string literal: 'end'
4$2#XX    % regexp with 4 inputs (all the above) and 2 outputs (start and end indices)
          % implicitly display start and end indices
```
[Answer]
# Octave, 43 Bytes
```
@(x)reshape(find(diff([0,x,0])),2,[])-[1;2]
```
`find(diff([0,x,0]))` finds all the positions where the input array changes between true and false. By reshaping this into a 2-by-n matrix we achieve two things: The changes from true to false, and from false to true are divided into two rows. This makes it possible to subtract 1 and 2 from each of those rows. Subtracting 1 from row one is necessary because Octave is 1-indexed, not zero-indexed. Subtracting 2 from row two is necessary because the `find(diff())` finds the position of the first false value, while we want the last true value. The subtraction part is only possible in Octave, not in MATLAB.
```
F=0;T=1;
x=[F,F,T,T,F,F,F,F,F,F,F,F,T,T,T,T,T,T,T,T,F,F,F,F,F,F,F,F,F,F,F,F,F,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,T,T]
reshape(find(diff([0,x,0])),2,[])-[1;2]
ans =    
    2   12   33   93
    3   19   54   94
x=[T,T,F,F,F,T,T,T,T,T,T,T,T,T,T,F]
reshape(find(diff([0,x,0])),2,[])-[1;2]
ans =    
    0    5
    1   14
```
[Answer]
## CJam, ~~27~~ 25 bytes
```
0qe`{~~{+}{1$+:X(]pX}?}/;
```
Expects input like `TTFTFT`. [Try it online](http://cjam.aditsu.net/#code=0qe%60%7B~~%7B%2B%7D%7B1%24%2B%3AX%28%5DpX%7D%3F%7D%2F%3B&input=FFTTFFFFFFFFTTTTTTTTFFFFFFFFFFFFFTTTTTTTTTTTTTTTTTTTTTTFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFTT).
### Explanation
```
0                               Push 0, to kick off index
qe`                             Push input and run length encode
                                e.g. FFFFTTTFT -> [[4 'F] [3 'T] [1 'F] [1 'T]]
{                 }/            For each pair in the RLE...
 ~                                Unwrap the pair
  ~                               Evaluate T -> 0 (falsy), F -> 15 (truthy)
   { }{         }?                 Ternary based on T/F
    +                                If 'F: add count to index
       1$+:X(]pX                     If 'T: output inclusive range, updating index
;                               Discard the remaining index at the top of the stack
```
[Answer]
# Japt, ~~34~~ ~~31~~ 25 bytes
Trying a new approach really worked out this time.
```
V=[]Ur"T+"@Vp[YY-1+Xl]};V
```
[Try it online!](http://ethproductions.github.io/japt?v=master&code=Vj1bXVVyIlQrIkBWcFtZWS0xK1hsXX07Vg==&input=IkZURkZUVFRGVCI=)
Input is an string with `F` for `false` and `T` for `true`. Output is an array of arrays; the string representation makes it look like a single array.
### How it works
```
          // Implicit: U = input string
V=[]      // Set V to an empty array. (Why don't I have a variable pre-defined to this? :P)
Ur"T+"    // Take each group of one or more "T"s in the input,
@         // and map each matched string X and its index Y to:
Vp[       //  Push the following to an array in V:
Y         //   Y,
Y-1+Xl    //   Y - 1 + X.length.
]};       //  This pushes the inclusive start and end of the string to V.
V         // Implicit: output last expression
```
Note: I now see that several people had already come up with this algorithm, but I discovered it independently.
### Non-competing version, 22 bytes
```
;Ur"T+"@Ap[YY-1+Xl]};A
```
In the [latest GitHub commit](https://github.com/ETHproductions/Japt/commit/0e43c90f2853308f4f7f7aca7759dd29a1eac1a5), I've added a new feature: a leading `;` sets the variables `A-J,L` to different values. `A` is set to an empty array, thus eliminating the need to create it manually.
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal), ~~12~~ 11 bytes
```
0J0p¬ØT‚ÅΩ‚Äπ·∫á2·∫á
```
[Try it Online!](http://lyxal.pythonanywhere.com?flags=&code=0J0p%C2%AFT%E2%81%BD%E2%80%B9%E1%BA%872%E1%BA%87&inputs=%5B0%2C0%2C1%2C1%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C1%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C1%2C1%5D&header=&footer=)
Translation of [my Jelly answer](https://codegolf.stackexchange.com/a/214394/98955).
## Explanation
```
0J0p¬ØT‚ÅΩ‚Äπ·∫á2·∫á
0J             Append 0
  0p          Prepend 0
    ¬Ø         Deltas
     T        Truthy indices
      ‚ÅΩ ·∫á     Apply to even indices
       ‚Äπ        Decrement
         2·∫á   Split into chunks of 2
```
*-1 byte thanks to lyxal*
[Answer]
## Haskell, 74 bytes
```
import Data.Lists
map(\l->(fst$l!!0,fst$last l)).wordsBy(not.snd).zip[0..]
```
Usage example: `map(\l->(fst$l!!0,fst$last l)).wordsBy(not.snd).zip[0..] $ [True,False,True,True,False]` -> `[(0,0),(2,3)]`.
How it works:
```
                               -- example input: [True,False,True,True,False]
zip[0..]                       -- pair each element of the input with it's index
                               -- -> [(0,True),(1,False),(2,True),(3,True),(4,False)]
wordsBy(not.snd)               -- split at "False" values into a list of lists
                               -- -> [[(0,True)],[(2,True),(3,True)]]
map                            -- for every element of this list
   (\l->(fst$l!!0,fst$last l)) -- take the first element of the first pair and the
                               -- first element of the last pair
                               -- -> [(0,0),(2,3)]
```
[Answer]
## J, 26 bytes
```
[:I.&.|:3(<`[/,]`>/)\0,,&0
```
This is an unnamed monadic verb (unary function) that returns a 2D array or integers.
It is used as follows.
```
  f =: [:I.&.|:3(<`[/,]`>/)\0,,&0
  f 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 0
0  1
5 14
```
## Explanation
```
[:I.&.|:3(<`[/,]`>/)\0,,&0
                       ,&0  Append 0 to input
                     0,     then prepend 0.
        3(         )\       For each 3-element sublist (a b c):
               ]`>/           Compute b>c
          <`[/                Compute a<b
              ,               Concatenate them
                            Now we have a 2D array with 1's on left (right) column
                            indicating starts (ends) or 1-runs.
[:I.&.|:                    Transpose, get indices of 1's on each row, transpose back.
```
[Answer]
# Ruby, 39
```
->s{s.scan(/T+/){p$`.size..s=~/.#$'$/}}
```
Sample invocation:
```
2.2.3 :266 > f=->s{s.scan(/T+/){p$`.size..s=~/.#$'$/}}
 => #<Proc:0x007fe8c5b4a2e8@(irb):266 (lambda)> 
2.2.3 :267 > f["TTFTTFTTTFT"]
0..1
3..4
6..8
10..10
```
The `..` is how Ruby represents inclusive ranges.
The one interesting thing here is how I get the index of the end of the range. It's weird. I dynamically create a regular expression that matches the last character of the range, and then all subsequent characters and the end of the string in order to force the correct match. Then I use `=~` to get the index of that regex in the original string.
Suspect there might be a shorter way to do this in Ruby using the -naF flags.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 12 11 10 bytes
```
;0≈ªIT‚Äô√êes2
```
[Try it online!](https://tio.run/##y0rNyan8/9/a4Ohuz5BHDTMPT0gtNvr//3@0gY6BjiEQGqBBQzRogBMakgANqAiB5sUCAA "Jelly ‚Äì Try It Online")
Accepts a list of zeros and ones. Outputs a list of 1-based ranges.
## Explanation
Using [1,1,0,1] as an example.
```
;0≈ªIT‚Äô√êes2   Main monadic link
;0           Append a zero: [1,1,0,1,0]
  ≈ª          Prepend a zero: [0,1,1,0,1,0]
   I         Increments: [1,0,-1,1,-1]
    T        Indices of truthy alements: [1,3,4,5]
      √êe     Apply to even indices:
     ‚Äô         Decrement: [1,2,4,4]
        s2   Split into groups of two: [[1,2],[4,4]]
```
[Answer]
# JavaScript (ES6), 59
An anonymous function, input as a string of `T` and `F`, returning output as an array of arrays
```
x=>x.replace(/T+/g,(a,i)=>o.push([i,a.length+i-1]),o=[])&&o
```
**TEST**
```
f=x=>x.replace(/T+/g,(a,i)=>o.push([i,a.length+i-1]),o=[])&&o
// TEST
arrayOut=a=>`[${a.map(e=>e.map?arrayOut(e):e).join`,`}]`
console.log=x=>O.textContent+=x+'\n'
;[
  'F','T','TTFT','FTTFFTTT','FTTFFFTTTT','TTFFFTTTTTTTTTTF',
  'FFTTFFFFFFFFTTTTTTTTFFFFFFFFFFFFFTTTTTTTTTTTTTTTTTTTTTTFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFTT'
].forEach(t=>console.log(t+'\n'+arrayOut(f(t))+'\n'))
```
```
<pre id=O></pre>
```
[Answer]
# ùîºùïäùïÑùïöùïü, 18 chars / 28 bytes
```
√Øƒß`T+`,‚Ü™·µñ[_,$Íùà+‚Ä°_]
```
`[Try it here (Firefox only).](http://molarmanful.github.io/ESMin/interpreter2.html?eval=false&input=TTFT&code=%C3%AF%C4%A7%60T%2B%60%2C%E2%86%AA%E1%B5%96%5B_%2C%24%EA%9D%88%2B%E2%80%A1_%5D)`
# Explanation
```
√Øƒß`T+`,‚Ü™·µñ[_,$Íùà+‚Ä°_] // implicit: √Ø=input
√Øƒß`T+`,            // for each T-sequence...
       ‚Ü™·µñ[_,$Íùà+‚Ä°_] // push [start index of sequence, end index of sequence] to the stack
                   // implicit stack output
```
[Answer]
## Haskell, 62 bytes
```
f l|s<-zip3[0..](0:l)$l++[0]=zip[i|(i,0,1)<-s][i-1|(i,1,0)<-s]
```
Takes as input a list of 0's and 1's.
Given the list `l`, pads it with 0 on both sides and computes the indexed list of consecutive pairs. For example
```
l = [1,1,0]
s = [(0,0,1),(1,1,1),(2,1,0),(3,0,0)]
```
Then, extract the indices corresponding to consecutive elements `(0,1)` and `(1,0)`, which are the starts of blocks of 0 and 1, subtracting 1 from the starts of 0 to get the ends of 1, and zips the results.
[Answer]
## Pyth, ~~19~~ 18 bytes
```
m-VdU2cx1aV+ZQ+QZ2
```
Explanation:
```
             implicit: Q=input
m            map lambda d:
  -V         Vectorized subtraction by [0,1]
     d
     U2     
c            split every 2 elements
  x            find all indexes of
    1          1s
    aV         in vectorized xor:
       +ZQ     Q with a 0 on the front
       +QZ     Q with a 0 on the end
  2
```
Try it [here](https://pyth.herokuapp.com/?code=m%2Chdtedcx1aV%2BZQ%2BQZ2&input=1%0A0%0A0010%0A10011000%0A1001110000%0A0011100000000001%0A11001111111100000000111111111111100000000000000000000001111111111111111111111111111111111111100&test_suite=1&test_suite_input=%5B0%5D%0A%5B1%5D%0A%5B1%2C+1%2C+0%2C+1%5D%0A%5B0%2C+1%2C+1%2C+0%2C+0%2C+1%2C+1%2C+1%5D%0A%5B0%2C+1%2C+1%2C+0%2C+0%2C+0%2C+1%2C+1%2C+1%2C+1%5D%0A%5B1%2C+1%2C+0%2C+0%2C+0%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+0%5D%0A%5B0%2C+0%2C+1%2C+1%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+1%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+0%2C+1%2C+1%5D&debug=0).
[Answer]
## Perl, 47 bytes
```
s/F*(T*)(T)F*/[$-[0],$+[1]],/g;chop$_;$_="[$_]"
```
With the following perlrun options `-lpe`:
```
$ perl -lpe's/F*(T*)(T)F*/[$-[0],$+[1]],/g;chop$_;$_="[$_]"' <<< 'TTFFFTTTTTTTTTTF'
[[0,1],[5,14]]
```
Alternative where output is line separated (34 bytes):
```
$ perl -pE's/F*(T*)(T)F*/$-[0] $+[1]\n/g;chomp' <<< TTFFFTTTTTTTTTTF
0 1
5 15
```
[Answer]
## APL, 17 chars
```
{(‚Üë,‚Üë‚àò‚äñ)¬®‚çµ‚äÇ‚çµ√ó‚ç≥‚ç¥‚çµ}
```
In `‚éïIO‚Üê0` and `‚éïML‚Üê3`.
In English:
* `‚çµ√ó‚ç≥‚ç¥‚çµ`: zero out the elements of the index vector as long as the argument where the argument is false
* `‚çµ‚äÇ`: cut at the beginning of each run of truths and throw away the false's
* `(‚Üë,‚Üë‚àò‚äñ)¬®`: take the first and last element of each subarray
[Answer]
## Python 2, 108 bytes
```
l=input();l+=[0];o=[];s=k=0
for i,j in enumerate(l):s=j*~k*i or s;~j*l[i-1]and o.append([s,i-1]);k=j
print o
```
Test cases:
```
$ python2 rangesinlists2.py
[0]
[]
$ python2 rangesinlists2.py
[-1]
[[0, 0]]
$ python2 rangesinlists2.py
[-1,-1,0,-1]
[[0, 1], [3, 3]]
$ python2 rangesinlists2.py
[0,-1,-1,0,0,-1,-1,-1]
[[1, 2], [5, 7]]
$ python2 rangesinlists2.py
[0,-1,-1,0,0,0,-1,-1,-1,-1]
[[1, 2], [6, 9]]
$ python2 rangesinlists2.py
[-1,-1,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0]
[[0, 1], [5, 14]]
$ python2 rangesinlists2.py
[0,0,-1,-1,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1]
[[2, 3], [12, 19], [33, 54], [93, 94]]
```
Surely there's a shorter solution than this, but it works.
[Answer]
## Haskell: 123 bytes (Example, cannot win)
```
f l=[(s,e)|let m=length l-1,let r=[0..m],s<-r,e<-r,and[l!!x|x<-[s..e]],s<=e,let(#)p=not$l!!p,s==0||(#)(s-1),e==m||(#)(e+1)]
```
Less golfed:
```
f l = [(start,end) | start <- [0..max], end <- [0..max], allTrue start end, start <= end, notBelow start, notAbove end]
  where
    max = (length l) - 1
    allTrue s e = and (subList s e)
    subList s e = [l !! i | i <- [s,e]]
    notBelow  s = (s == 0) || (not (l !! (s-1)))
    notAbove  e = (s == m) || (not (l !! (e+1)))
```
[Answer]
## CJam, 30 bytes
```
0l~0++2ewee{1=$2,=},{~0=-}%2/`
```
Input as a CJam-style array of `0`s and `1`s. Output as a CJam-style array of pairs.
[Run all test cases.](http://cjam.aditsu.net/#code=qN%2F%7BS%2F1%3D%22FT%2C%22%2201%20%22er%3AL%3B%0A%0A0L~0%2B%2B2ewee%7B1%3D%242%2C%3D%7D%2C%7B~0%3D-%7D%252%2Fp%0A%0A%5Do%7D%2F&input=f%20%5BF%5D%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3D%20%5B%5D%0Af%20%5BT%5D%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3D%20%5B%5B0%2C0%5D%5D%0Af%20%5BT%2CT%2CF%2CT%5D%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3D%20%5B%5B0%2C1%5D%2C%5B3%2C3%5D%5D%0Af%20%5BF%2CT%2CT%2CF%2CF%2CT%2CT%2CT%5D%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3D%20%5B%5B1%2C2%5D%2C%5B5%2C7%5D%5D%0Af%20%5BF%2CT%2CT%2CF%2CF%2CF%2CT%2CT%2CT%2CT%5D%20%20%20%20%20%20%20%20%20%20%20%20%20%3D%20%5B%5B1%2C2%5D%2C%5B6%2C9%5D%5D%0Af%20%5BT%2CT%2CF%2CF%2CF%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CF%5D%20%3D%20%5B%5B0%2C1%5D%2C%5B5%2C14%5D%5D%0Af%20%5BF%2CF%2CT%2CT%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CT%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CF%2CT%2CT%5D%20%3D%20%5B%5B2%2C3%5D%2C%5B12%2C19%5D%2C%5B33%2C54%5D%2C%5B93%2C94%5D%5D) (Takes care of the conversion of the input formats.)
[Answer]
# Japt, 27 bytes
```
A=[];Ur"T+"@Ap[YXl +¬¥Y]};A¬∑
```
There has to be a way to golf this down...
Anyway, it's the same as my ùîºùïäùïÑùïöùïü answer.
[Answer]
# [Husk](https://github.com/barbuz/Husk), 14 bytes
```
¬ßzeW<om‚ÜêW>`:0Œò
```
[Try it online!](https://tio.run/##yygtzv7//9DyqtRwm/zcR20Twu0SrAzOzfj//3@0gY6BjiEQGqBBQzRogBMakgANqAiB5sUCAA "Husk ‚Äì Try It Online")
[Answer]
# [K (oK)](https://github.com/JohnEarnest/ok), 19 bytes
```
+&:'+{y&~x,z}.'-3':
```
[Try it online!](https://tio.run/##y9bNz/7/P81KW81KXbu6Uq2uQqeqVk9d11jd6n@auoZBkrUhEBkaAEkDIAXEMBaICZGDMCEAqMEAIg0GcGFkYIgVGBAFgFZq/gcA)
Uses `-n':` (window) so the inner `{y&!x,z}` function has access to the previous (`x`), current (`y`), and next (`z`) value in the input boolean list.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 13 bytes
```
TI‚Äôk∆ä.·ªã‚±Æ$·∏¢·∫†?U
```
[Try it online!](https://tio.run/##y0rNyan8/z/E81HDzOxjXXoPd3c/2rhO5eGORQ93LbAP/X@4/VHTmqOTHu6c8f9/NBdntEGsjgJ@oKxgqxAdC1RqSJzSaAMdg1iweh1DHQMdfLpg6oFqoo11jMG6gDywPgiNTTdEl6GOEVCXqY45mi6oPgydyLrMdCyRXIikBwWCggbZhaY6hiZQy5CtQ0AMA3BCQxKgARUhKFigfjIChrdOtKGRjqElKPSNdUxNgLSlsY4lyJOxAA "Jelly ‚Äì Try It Online")
+4 bytes to handle the all `0`s test cases. Without that, a much cleaner [9 bytes](https://tio.run/##y0rNyan8/z/E81HDzOxjXXoPd3c/2rgu9P/h9kdNa45Oerhzxv//0Vyc0YaxOgr4gbKCrUJ0tIGOQWwsSL2OoY6BDj5dMPVANdHGOsZgXUAeWB@ExqYbostQxwioy1THHE0XVB@GTmRdZjqWSC5E0oMCDYAmILvQVMfQBGoZsnUIiGEATmhIAjSgIgQFC9RPRsDw1ok2NNIxtASFvrGOqQmQtjTWsQR5MhYA). This uses 1 indexing, which is Jelly's default.
## How it works
```
TI‚Äôk∆ä.·ªã‚±Æ$·∏¢·∫†?U - Main link
T             - Indices of truthy elements
    ∆ä         - Group the previous links into a monad f(T):
 I            -   Increments
  ‚Äô           -   Decrement
   k          -   Partition T at truthy indexes in the decremented increments
                This returns [[]] for [0] (and repeats) and
                [[a, b], [c, d, e], ...] for every other input
           ?  - If:
          ·∫†   -   Condition: All truthy?
        $     -   If:
       ‚±Æ      -     For each partition:
     .·ªã       -       Take the 0.5th element
         ·∏¢    -   Else: Return []
                For non-integer left argument, x, Jelly's ·ªã atom takes
                floor(x) and ceil(x) and returns [floor(x)·ªãy, ceil(x)·ªãy]
                As Jelly's indexing is 1-based and modular:
                  0·ªã returns the last element
                  1·ªã returns the first element
                  .·ªã returns [0·ªã, 1·ªã]
            U - Reverse, as the ranges yielded by .·ªã are "reversed"
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), 11 bytes
```
m¬ße‚Üê‚Üíƒ°o=‚ÜíŒ∑f
```
[Try it online!](https://tio.run/##yygtzv7/P/fQ8tRHbRMetU06sjDfFkid2572////aAMdAx1DIDRAg4Zo0AAnNCQBGlARAs2LBQA "Husk ‚Äì Try It Online")
```
m¬ße‚Üê‚Üíƒ°o=‚ÜíŒ∑f
         Œ∑f     # get truthy indices
     ƒ°o=‚Üí       # group runs of adjacent values
m               # then, for each group
 ¬ße‚Üê‚Üí           # get the first & last elements
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 12 bytes
Uses `0/1` for `F/T`.
```
√ÖŒ≥.¬•√º2s√è‚Ç¨ŒµN-
```
[Try it online!](https://tio.run/##yy9OTMpM/f//cOu5zXqHlh7eY1R8uP9R05pzW/10//@PNtAx0DEEQgM0aIgGDXBCQxKgARUh0LxYAA "05AB1E ‚Äì Try It Online")
`√ÖŒ≥` run-length encodes the input, pushing the chunk elements and the chunk lengths.  
`.¬•` takes the cumulative sum of the chunck lengths and prepends a 0.  
`√º2` creates pairs of all adjacent numbers in this list.  
`s` swaps to the list of chunk elements.  
`√è` selects each pair which is at the same index as a truthy chunk. The selected pairs are now the half-inclusive truthy range `[a, b)`.  
`‚Ç¨Œµ` iterates over every number in every range, and `N-` subtracts the 0-based index from each number to get the inclusive ranges.
[Try it with step-by-step output!](https://tio.run/##yy9OTMpM/f//cOu5zQpAoKQABkGlebo5qXnpJRkKqXnJ@SmpVgpK9pouCcX2SgqJeSlAjk5RAheX3qGlSJqAwLk0tzQnsSSzLFWhuDQXpMmWi@vwHiNUVY4pWYnJqXklCgWJmUXFUFXFh/vBqoJTc1KTSxQSSxRKikpLMioVkjNK87Jhqh41rTm31U@3Fm5acGlSSVEiUENmXkpmcipE3f//0YY6hjoGYGiIBRrEAgA)
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 9 bytes
```
·∫è‚Ä°?i≈ªv‚ÇçgG
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCLhuo/igKE/acW7duKCjWdHIiwiIiwiWzAsMSwwLDEsMSwxLDAsMV0iXQ==)
[Answer]
# PowerShell, 82 bytes
```
("$args"|sls 't+'-A).Matches|%{if($_){'{0},{1}'-f$_.Index,($_.Index+$_.Length-1)}}
```
Regex solution, using [MatchInfo](https://msdn.microsoft.com/en-us/library/microsoft.powershell.commands.matchinfo.aspx) object's properties.
# Example
```
PS > .\BoolRange.ps1 'F'
PS > .\BoolRange.ps1 'T'
0,0
PS > .\BoolRange.ps1 'TTFFFTTTTTTTTTTF'
0,1
5,14
```
]